From 960ef54c94dfe059fabec7d3033ee9569bb192ba Mon Sep 17 00:00:00 2001 From: Eric Phillips Date: Sun, 9 Nov 2014 19:53:32 -0700 Subject: [PATCH] added cmus dwm status bar script --- cmus-stats.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 cmus-stats.sh diff --git a/cmus-stats.sh b/cmus-stats.sh new file mode 100755 index 0000000..d5cf5ee --- /dev/null +++ b/cmus-stats.sh @@ -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