You are not logged in.
https://github.com/brontosaurusrex/radioClicky
Requires: reasonably modern mpv, socat, notify-send, sed, grep, pgrep (procps), latest tint2, inotify-tools, jq
Likes: curl, wget, streamripper
Change array to your favorite radio stations and add appropriate stuff to tint2rc.
Check the needs
radioClicky sysinfo
may return
mpv 0.27.0-226-gb3178eb59e (C) 2000-2017 mpv/MPlayer/mplayer2 projects
--lavfi-complex String (default: )
socat version 1.7.3.1 on Jul 14 2017 13:52:03
tint2 version 15.2
notify-send 0.7.7
inotifywait 3.14
sed (GNU sed) 4.4
grep (GNU grep) 2.27
pgrep from procps-ng 3.3.12
Streamripper 1.64.6
GNU Wget 1.18 built on linux-gnu.
curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
jq-1.5-1-a5b5cbe
macpro @ Debian GNU/Linux 9.2 (stretch) / 4.9.0-4-amd6
It will look like this: ' / 12' for on or this ' \ ' for off. '12' is stream id.
Optional openbox pipemenu and some conkyness
Long&boring install/test/debug instructions:
1. install
# required
sudo apt install mpv libnotify-bin sed procps socat jq inotify-tools curl wget
# script
cd ~/bin
wget https://raw.githubusercontent.com/brontosaurusrex/stretchbang/master/bin/radioClicky
chmod +x radioClicky
# configure script as needed, change
# array=("url1" "url2" "urlN")
# to your prefered radio stations.
2. test from terminal
radioClicky # show status
radioClicky toggle # on/off
radioClicky notify # notify-send (or echo) icy-title or stream url
radioClicky + # next station
radioClicky - # prev station
radioClicky 5 # station with id 5
radioClicky sysinfo # post this with your complaint
radioClicky help # for more
2. b) make short version of command (optional for easier cli usage), a softlink:
cd ~/bin
ln -s radioClicky r
# now 'r' is your new command
Note: radioClicky is perfectly useful from cli, so if you don't need any gui's thats it.
^ tmux left: interactive cli, right: 'radioClicky spam'
3. a) Adding to tint2 as executor
radioClicky tint2 # for instructions
3. b) and/or Adding to openbox menu (optional)
# In .config/openbox/menu.xml add
<menu id="radio" label="radio" execute="radioClicky openbox" />
3. c) conky showing last 5 valid icy-titles (optional)
${font RobotoCondensed-Light:size=12}${color cccccc}
${execpi 5 radioClicky last | tail -n 5}
3. d) example shortkeys in openbox rc.xml (alt + e, r, t, n)
<!-- toggleRadio -->
<keybind key="A-r">
<action name="Execute">
<command>r t</command>
</action>
</keybind>
<!-- Radio next -->
<keybind key="A-t">
<action name="Execute">
<command>r +</command>
</action>
</keybind>
<!-- Radio prev -->
<keybind key="A-e">
<action name="Execute">
<command>r -</command>
</action>
</keybind>
<!-- Radio what song -->
<keybind key="A-n">
<action name="Execute">
<command>r n</command>
</action>
</keybind>
4. debug
Start tint2 from terminal and observe what happens when you click on the '/'.
At this point you should be in business, if not:
5. Complain, please add this output next to your complaint:
radioClicky sysinfo
6. changelog
- Changed internals to bidirectional remote model (mpv).
- Changed tint2 executor to continuous version
Last edited by brontosaurusrex (2017-10-30 14:19:38)
Offline
Looks convenient but you'll have to talk me through it. Putting it in ~/bin, naming it radioClicky and making it executable doesn't WFM.
/thick in the head
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
Testing from cli:
radioClicky toggle # on/off
radioClicky notify # notify-send icy-title
radioClicky # show status
If that is working fine, next step is that tint2rc executor code, basically patching lmb to "toggle", rmb to "notify" and occasional refresh to "show status", that way you can stop toggle it from cli and tint2 will eventually refresh.
note: Bunch of code is missing to check for actual pid/mpv playback (maybe later).
Last edited by brontosaurusrex (2017-09-30 10:41:51)
Offline
ah, thanks. radioClicky play has it running, but no slash in the systray yet.
-edit- lol, your station is currently doing caller "Yo' mamma is...' jokes. Good times.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
There is no "play" in latest version, check if you are up to date. Edit: It's not a systray, it's an executor thing.
Last edited by brontosaurusrex (2017-10-01 05:45:34)
Offline
radioClicky - hehe, this just too cool! It worked fine for me from terminal (not the tint2 stuff so far). While trying it out I also received "line 13 no such process" error messages, but I might have done something wrong.
If you check the running processes, you might notice "youtube-dl". Starting mpv with --no-ytdl stops running it.
For the life of me I could not filter out the url for xray.fm in FF (at least the one in the network tab did not work...
Offline
"line 13 no such process"
@martix, Thats missing code for actual check, rm ~/tmp/radiopid should fix it.
mpv with --no-ytdl
Fixed.
Also noticed that older tint (stretch version) will not refresh the status after click (it will eventually on interval), don't know how to fix that and I don't want to do another continuous kind of script, it's pain to do.
For the life of me I could not filter out the url for xray.fm in FF
http://listen.xray.fm:8000/stream
(In FF inspector under network/other)
Last edited by brontosaurusrex (2017-09-30 11:48:50)
Offline
^Many thanks for the link! Great to have this radio-url, I was looking for it several times.
I'm not sure what I'm doing wrong, all I find under network/other is "Remote adress: 195.181.217.58:443" - which is not the stream.
I'm wondering: Is the original idea having a "/" or "\" in the system tray and clicking on it turn on/off the radio? Anyhow it's a great little tool for the terminal even without tint2.
Offline
I'm wondering: Is the original idea having a "/" or "\" in the system tray and clicking on it turn on/off the radio? Anyhow it's a great little tool for the terminal even without tint2.
Certainly could be seen somewhere, so I can't claim that, hardly an idea anyway
Offline
Not to rain on bronto's parade, but if anyone wants a more flexible systray radio icon...
https://github.com/ebruck/radiotray-ng
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
^ That's neat, but I like the idea of rex's simple script.. It works here at the command line, but left, right-clicking the / on thint2 has no effect. I also like the radio streams posted.
For what it's worth, here's Kevin Smith's "Smodcast Internet Radio." Some shows are better than others, and it's very NSFW language.
http://64.150.176.42:8242/stream
Offline
@obscuration, a. Perhaps post your tint2rc and tint2 --version.
b. To see what's going on, (debug) start tint2 from terminal and click around.
edit: I have added long&boring install instructions to first post ^.
Last edited by brontosaurusrex (2017-10-01 06:25:03)
Offline
Added openbox pipe menu option as an option, it's pretty awesome at this point imho (almost brilliant).
Last edited by brontosaurusrex (2017-10-04 06:58:43)
Offline
@obscuration, a. Perhaps post your tint2rc and tint2 --version.
b. To see what's going on, (debug) start tint2 from terminal and click around.
edit: I have added long&boring install instructions to first post ^.
It works great now. I upgraded to tint2 15.2, not sure if that's related the issue I had.
Added openbox pipe menu option as an option, it's pretty awesome at this point imho (almost brilliant).
It's really cool and minimal.
Last edited by obscurant (2017-10-04 09:07:04)
Offline
^Oh, it works for you on 15.2? Hmmm, I must be doing something wrong... I have all the packages, added E, starting in terminal shows correctly "panel items: LTSCE", code added to the end of tint2rc too, I can even see tint2 showing in terminal "tint2: Executing: radioClicky # echo status / or \"-messages but there is nothing to see in tint2. Tried also LTSEC and ELTSC, changed font type and size - no luck.
Otherwise it's really cool from command line, that 'almost' can be surely removed from the title. Unfortunately radionomy has geoblocking but the other stations work great.
Last edited by martix (2017-10-04 10:22:38)
Offline
@martix: post your tint2rc?
Offline
The version of mpv shipped with Bundenlabs Hydrogen doesn't support the --no-ytdl switch, or the lavfi switch, and will fail.
Error parsing option no-ytdl (option not found)
Setting commandline option --no-ytdl= failed.
Exiting... (Fatal error)
[libav] AVFilterGraph: No such filter: 'loudnorm'
[lavfi] Can't configure libavfilter graph.
Reinitialization did not work, audio filter 'lavfi' returned error code -2
Could not create audio filter chain.
Error at audio filter chain pre-init!
Audio: no audio
Nor does the version in jessie backports (not sure if they're the same version).
It works fine without those switches though.
Offline
@brontosaurusrex
NICE WORK! bookmarked for dwmXS inclusion
Offline
The version of mpv shipped with Bundenlabs Hydrogen doesn't support the --no-ytdl switch, or the lavfi switch, and will fail.
Error parsing option no-ytdl (option not found) Setting commandline option --no-ytdl= failed. Exiting... (Fatal error)
[libav] AVFilterGraph: No such filter: 'loudnorm' [lavfi] Can't configure libavfilter graph. Reinitialization did not work, audio filter 'lavfi' returned error code -2 Could not create audio filter chain. Error at audio filter chain pre-init! Audio: no audio
Nor does the version in jessie backports (not sure if they're the same version).
It works fine without those switches though.
Thanks for reporting, will think about how to catch and report bad exists, if there is a low verbosity stderr switch that will work with modern and older mpvs. Or at least catch mpv exiting with error. Until then I'd stick that under 'configure the script'. p.s. Another option is to change entire model to running mpv as slave, don't know if it's really worth bothering (It will make script at least two times larger and it's getting quite fat even without that).
edit: status function should now at least catch the situation when player has exited and pidfile is still there (status echoes when running radioClicky with no switches), eventually showing something like '/ err', showing ' \ ', basically I'am scripting around instead of attacking real problem (flaky model).
Last edited by brontosaurusrex (2017-10-05 01:40:12)
Offline
@brontosaurusrex
NICE WORK! bookmarked for dwmXS inclusion
Cool and thanks.
Offline