Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 4056

Programming • [Bash] Troubles to write a bash completion file

$
0
0

Hi there :D

I wrote a simple command line tool to play a web radio from the command line using ffmpeg's ffplay :

https://github.com/hotnuma/radio

It uses a config file containing web radios like so :

Code:

[elettrica]url=https://nr8.newradio.it/proxy/apselett?mp=/streamvolume=50[mizrahit]url=https://mzr.mediacast.co.il/mzradio[sabrosita]url=https://playerservices.streamtheworld.com/api/livestream-redirect/XEPHAMAAC.aacaf=acompressor=mode=upward:threshold=-8dB:ratio=2:knee=2.82:attack=6:release=60,volume=60/100

To play a radio I do for example :

Code:

radio elettrica

It will play that excellent Italian radio. :D

I managed to write a simple bash completion file like this :

https://raw.githubusercontent.com/hotnu ... radio.comp

And here is the question.

How is it possible to have a completion that works for stations names. So that if I type radio el<TAB> it would complete with elettrica
I assume I would have to generate a keyword list from config sections, like so :
elettrica mizrahit sabrosita

I'm blocked here, I've no idea how I can do that.

If anyone has an idea, it would be very helpful.

Thanks in advance. :D

Statistics: Posted by hotnuma — 2026-01-21 17:37



Viewing all articles
Browse latest Browse all 4056

Trending Articles