touch_radio/gui
2019-09-19 21:27:57 +01:00

84 lines
4.0 KiB
Bash
Executable File

#!/bin/sh
GTKDIALOG=gtkdialog
radioBtn() {
echo '<button>
<label>'$1'</label>
<action>./play "'$2'"</action>
</button>'
}
MAIN_DIALOG='
<window title="Radio">
<vbox>
<hbox>
'"`radioBtn "Radio 1" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p`"'
'"`radioBtn "Radio 2" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p`"'
'"`radioBtn "Radio 3" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio3_mf_p`"'
'"`radioBtn "Radio 4" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p`"'
'"`radioBtn "Radio 4 Extra" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_p`"'
'"`radioBtn "Radio 5 Live" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5live_mf_p`"'
'"`radioBtn "Radio 6 Music" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p`"'
</hbox>
<hbox>
'"`radioBtn "BBC Cornwall" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrcorn_mf_p`"'
'"`radioBtn "BBC Devon" http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrdevon_mf_p`"'
'"`radioBtn "Pirate FM" https://str4.sad.ukrd.com/pirate?rp=3.1.2&ts=1553703504&norequeue=1`"'
</hbox>
<hbox>
'"`radioBtn "R1 Dubstep" https://streaming.radionomy.com/R1Dubstep`"'
'"`radioBtn "R1 Melodic Dubstep" https://streaming.radionomy.com/R1MelodicDubstep`"'
'"`radioBtn "Dubstep.fm" https://www.dubstep.fm/256aac.m3u`"'
'"`radioBtn "Dubstep Radio" http://198.15.94.34:8018/stream`"'
</hbox>
<hbox>
'"`radioBtn "HBR1 Tranceponder" http://radio.hbr1.com:19800/trance.ogg.m3u`"'
'"`radioBtn "HBR1 Tronic Lounge" http://radio.hbr1.com:19800/tronic.ogg.m3u`"'
'"`radioBtn "HBR1 Dream Factory" http://radio.hbr1.com:19800/ambient.ogg.m3u`"'
</hbox>
<hbox>
'"`radioBtn "Rock Radio Beograd" http://ca6.rcast.net:4020/\;stream.mp3`"'
</hbox>
<hbox>
'"`radioBtn "80s Online Radio" http://149.56.195.94:8404/autodj`"'
'"`radioBtn "Pilot Lounge" http://188.254.50.254:8000/pilot_lounge_mp3`"'
'"`radioBtn "Punk FM" http://94.23.26.22:8090/live.mp3`"'
'"`radioBtn "Verket opus" http://mustafejen.se:8000/verket.opus`"'
'"`radioBtn "Celtic-Folk-Punk" http://streaming211.radionomy.com:80/Celtic-Folk-Punk`"'
'"`radioBtn "Record Russian Hits" http://air.radiorecord.ru:8102/russianhits_320`"'
'"`radioBtn "Radio Dom Druzhbi" http://62.109.3.230:80/dom_druzhby.mp3`"'
'"`radioBtn "100CHILL" http://streaming211.radionomy.com:80/100-CHILL`"'
'"`radioBtn "Radio House" http://142.44.135.172:8001/listen`"'
</hbox>
<text wrap="false" xalign="0.5" selectable="true">
<variable>txtTitles</variable>
<label>This text will be overwritten with the data from the command.</label>
<input>tail -n100 /tmp/play | grep icy-title | sed -e 's/icy-title://' | tail -n1</input>
</text>
<timer interval="1" visible="false">
<action>refresh:txtTitles</action>
</timer>
<hbox>
<button>
<input file icon="text-x-generic"></input>
<label>Info</label>
<action>tail -n100 /tmp/play | tac | zenity --height=10000 --width=10000 --text-info </action>
</button>
<button cancel></button>
</hbox>
</vbox>
</window>
'
export MAIN_DIALOG
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG -G +10000 +10000 --space-expand=true --space-fill=true --program=MAIN_DIALOG ;;
esac
killall mpv