aboutsummaryrefslogtreecommitdiff
path: root/ratpoison/panel/music
diff options
context:
space:
mode:
authorVasil Zlatanov <vasil.zlatanov@gmail.com>2015-03-15 00:54:36 +0100
committerVasil Zlatanov <vasil.zlatanov@gmail.com>2015-03-15 00:54:36 +0100
commit02dbe85011616cc97332c7e56e39a8989c45de08 (patch)
tree2e13d80b0a2afc806b92c078ab9ac144fd31ba92 /ratpoison/panel/music
parenta58d24aac0bdb7dd0f006818d9f30f9deadbb6b1 (diff)
downloaddotfiles-02dbe85011616cc97332c7e56e39a8989c45de08.tar.gz
dotfiles-02dbe85011616cc97332c7e56e39a8989c45de08.tar.bz2
dotfiles-02dbe85011616cc97332c7e56e39a8989c45de08.zip
efficiency + battery
Diffstat (limited to 'ratpoison/panel/music')
-rwxr-xr-xratpoison/panel/music31
1 files changed, 2 insertions, 29 deletions
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