added cmus-stats to yoga2 branch

This commit is contained in:
2014-11-09 20:49:46 -07:00
parent bb79497d94
commit d7bd0fc127
Executable
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
if [ -x /usr/bin/cmus-remote ]
then
status=`cmus-remote -Q | grep status | awk '{print $2}'`
if [ $status == "paused" ]
then
status="ç"
else
status="æ"
fi
duration=`cmus-remote -Q | grep duration | awk '{print $2}'`
position=`cmus-remote -Q | grep position | awk '{print $2}'`
((timeleft = $duration - $position))
((timelefth = timeleft / 60))
((timeleftm = timeleft % 60))
artist=`cmus-remote -Q | grep -w artist | cut -d ' ' -f3-`
song=`cmus-remote -Q | grep title | cut -d ' ' -f3-`
echo $artist'-'$song $status $timelefth':'$timeleftm
fi