From 02dbe85011616cc97332c7e56e39a8989c45de08 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Sun, 15 Mar 2015 00:54:36 +0100 Subject: efficiency + battery --- ratpoison/panel/music | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) (limited to 'ratpoison/panel/music') diff --git a/ratpoison/panel/music b/ratpoison/panel/music index 3de320d..caec3d7 100755 --- a/ratpoison/panel/music +++ b/ratpoison/panel/music @@ -1,25 +1,8 @@ #!/bin/sh - -f=1 -d=30 # width - while true;do new=`mpc current` -if [ "$old" != "$new" ];then -f=1; -old="$new" -fi - - -e=$(expr $f + $d) - -if [ $e -gt ${#new} ];then -e=${#new} -f=$(expr $e - $d) -if [ $f -lt 1 ];then f=1;fi -fi if mpc | grep -q playing; then symbol='p' @@ -27,17 +10,7 @@ else symbol='P' fi -echo $f -echo $e -echo ${#new} -echo "$symbol`echo $new | cut --bytes $f-$e`" +echo "$symbol`echo $new | cut --bytes 1-30`" echo "K`mpc -h 127.0.0.1 volume | perl -pe 's/^volume://' | perl -pe 's/%$//' | perl -pe 's/^ //'`" - -f=$(expr $d / 2 + $f) - -if [ $e == ${#new} ];then -f=1; -fi - -sleep 2; +mpc idle > /dev/null done -- cgit v1.2.3-54-g00ecf