You are not logged in.
Pages: 1
I just wanted to share a little script I'm using in scrotwm to display moc status in the bar.
#!/bin/bash
SLEEP=1
while :; do
STATE=`mocp --info | grep State | cut -d" " -f2`
if [[ $STATE = "STOP" ]];
then
echo "MOC Stopped"
else
ARTIST=`mocp --info | grep Artist`
TITLE=`mocp --info | grep SongTitle`
ALBUM=`mocp --info | grep Album`
CTIME=`mocp --info | grep CurrentTime | cut -d" " -f2`
TTIME=`mocp --info | grep TotalTime | cut -d" " -f2`
echo "$STATE:::$ARTIST:::$ALBUM:::$TITLE:::$CTIME/$TTIME"
fi
sleep $SLEEP
doneIt's quite simple, the output looks like this:
PLAY:::Artist: Bob Marley & the Wailers:::Album: Legend:::SongTitle: Jammin':::00:11/03:33To have a correct output be sure that the mocp server is up when the script is running or add a condition to manage the case of a server down.
Cheers.
Last edited by ErSandro (2011-10-26 09:33:15)
Offline
Nice one. Plus, another scrowtm junkie 
The next version of #! should probably have scrotwm installed by default, so people can choose it from GDM.
Offline
Always loved tiling 
Normally I prefer manual tiling, but scrotwm is my favourite auto tiling WM. Especially now, the new version made possible to lower/raise clients and that's sooo cool. Now with scrotwm I can do anything I used to do with musca and much more.
Indeed it's a nice piece of software.
Offline
I've actually been using this string to get the Artist - Track to show up in the Scrotbar through Conky:
${exec mocp -Q %artist} - ${exec mocp -Q %song}But your script is more informative. I'll definitely have to try this out. Thanks ErSandro. 
We are a nice, friendly community here and I hope we stay that way.
Offline
^You're right, i slighlty modified the script.
#!/bin/bash
SLEEP=1
while :; do
STATE=`mocp -Q %state`
if [[ $STATE = "STOP" ]];
then
echo "MOC Stopped"
else
ARTIST=`mocp -Q %artist`
TITLE=`mocp -Q %song`
ALBUM=`mocp -Q %album`
CTIME=`mocp -Q %ct`
TTIME=`mocp -Q %tt`
echo "$STATE:::Artist - $ARTIST:::Album - $ALBUM:::Title - $TITLE:::Time - $CTIME/$TTIME"
fi
sleep $SLEEP
doneNow the ouptut looks like this:
PAUSE:::Artist - Bob Marley & the Wailers:::Album - Legend:::Title - Satisfy My Soul:::Time - 02:36/04:33Thanks for the advice.
Last edited by ErSandro (2011-10-26 11:45:41)
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.