xinit: Start MPD updater

This commit is contained in:
Tom Willemsen 2013-03-04 11:12:45 +01:00
parent b13108a005
commit 8aad7173c4

View file

@ -1,4 +1,26 @@
#!/bin/bash #!/bin/bash
function update_mowedline_mpd ()
{
while read action; do
if [ "$action" == "player" ]; then
IFS='' read -ra INFO <<< "`mpc status | tr '\n' `"
if [ "${INFO[1]}" == "" ]; then
mowedline-client -update mpd ""
else
TXT=" ${INFO[0]}"
ST="`echo ${INFO[1]} | sed 's/\[\(.*\)\] .*/\1/'`"
if [ "$ST" == "paused" ]; then
TXT="$TXT (paused)"
fi
mowedline-client -update mpd " $TXT"
fi
fi
done
}
xmodmap ~/.Xmodmap xmodmap ~/.Xmodmap
# Source scripts in /etc/X11/xinit/xinitrc.d/ # Source scripts in /etc/X11/xinit/xinitrc.d/
@ -15,5 +37,9 @@ mowedline &
xcompmgr -n -r 0 & xcompmgr -n -r 0 &
feh --bg-tile ~/pictures/wallpapers/wallpaper-864137.jpg feh --bg-tile ~/pictures/wallpapers/wallpaper-864137.jpg
{
mpc idleloop | update_mowedline_mpd
} &
test -n "$1" && wm=$1 || wm="xmonad" test -n "$1" && wm=$1 || wm="xmonad"
exec $wm exec $wm