moc users might know this and might not, but you can poll the moc server process to spit out information about the tune it’s playing. It’s something easier done than said, with just this command from a prompt:
mocp -Q %song
There are plenty of other variables you can use there; check the man page for a full list. You can also prepend that with a little explanatory text, and the output is adjusted properly. For example:
mocp -Q Now\ playing:\ %song
If you cull some error messages in the process (the Arch version will complain that it doesn’t have certain libraries installed, for example), that is easily corrected:
mocp -Q Now\ playing:\ %song 2>/dev/null
Pipe that through figlet, because small letters are boring:
mocp -Q Now\ playing:\ %song 2>/dev/null | figlet -t -c
Some crude looping, just for kicks:
while true ; do clear ; mocp -Q Now\ playing:\ %song 2>/dev/null | figlet -t -c ; sleep 15s ; done
The watch
command might also be useful there. Dump that line into a file, set it to executable and cue screen to use it as the blankerprg
. From screen’s prompt (CTRL+A : ) …
blankerprg script.sh
idle 90 blanker
Wait 90 seconds and bingo! a screensaver for the console that displays the tune currently playing. Isn’t Linux fun?!
Very nice. I used to run Moc and I never realized it could do that.
You can do much the same thing with mpd and mpc with a small modification of the above command:
while true ; do clear ; mpc | awk ‘/-/ {print $0} | figlet -t -c ; sleep 15s ; done
hey, doc, did you see this monster
http://www.cubic.org/player/index.html
haven’t tried it… and i guess i won’t..
No, I hadn’t seen that one. I think I shall take a look though. … 😀
Pingback: Improving the mocp status screensaver « Motho ke motho ka botho