mpdupdate improvements
This commit is contained in:
parent
42ae78dc0d
commit
5455b2d80c
1 changed files with 4 additions and 4 deletions
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit
|
# Whenever the mpd state changes, update the mpd i3 module.
|
||||||
|
kill -0 "$(cat /tmp/mpdupdate)" 2>/dev/null && exit || echo $$ > /tmp/mpdupdate
|
||||||
|
|
||||||
sleep 5 && while : ; do
|
sleep 5 && while : ; do
|
||||||
pgrep -x mpd || exit
|
pkill -RTMIN+11 i3blocks
|
||||||
mpc idle > /dev/null
|
mpc idle >/dev/null || exit
|
||||||
pkill -RTMIN+11 i3blocks ;
|
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue