Submitted scripts and programs
Forum rules
Your own work only.
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald


Unread post by machinebacon » Thu Feb 04, 2016 1:52 pm

Maybe your /usr/local/share/radiolist gets bigger and bigger and you just want to quickly access a stream by its name - do that using dmenu! Save the script here as dmenu_radio in /usr/local/bin for example, make it executable, then assign a keybinding in your wm to dmenu_radio

Code: Select all

# play radio streams using dmenu

if [ "$(pidof mpg123)" ] ; then
        echo "Stopping $selection ..." | osd_cat -s 0 -S white -c white -p bottom -A center -d 2 -l 1
        killall mpg123
        exit 0

stations="$(cat /usr/local/share/radiolist)"
selection="$(echo "$stations" | dmenu "$@")"
player() { mpg123 -C -@ "$@" 2>/dev/null & }
echo "Playing $selection ..." | osd_cat -s 0 -S white -c white -p bottom -A center -d 5 -l 1 &
player $selection

Post Reply