diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2019-04-24 19:38:09 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2019-04-24 19:38:09 -0400 |
| commit | 5455b2d80c8b79be4fa711520d35735cd343f924 (patch) | |
| tree | 43d969320b842ef13e87ce26f4a94e5c37ba2a8c /.scripts/statusbar | |
| parent | 42ae78dc0d0557cd3414e30d5b63495e97adb9ac (diff) | |
| download | eibhear-5455b2d80c8b79be4fa711520d35735cd343f924.tar.gz eibhear-5455b2d80c8b79be4fa711520d35735cd343f924.tar.zst eibhear-5455b2d80c8b79be4fa711520d35735cd343f924.zip | |
mpdupdate improvements
Diffstat (limited to '.scripts/statusbar')
| -rwxr-xr-x | .scripts/statusbar/mpdupdate | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/.scripts/statusbar/mpdupdate b/.scripts/statusbar/mpdupdate index 9a57ca4..afe11bb 100755 --- a/.scripts/statusbar/mpdupdate +++ b/.scripts/statusbar/mpdupdate @@ -1,8 +1,8 @@ #!/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 - pgrep -x mpd || exit - mpc idle > /dev/null - pkill -RTMIN+11 i3blocks ; + pkill -RTMIN+11 i3blocks + mpc idle >/dev/null || exit done |
