diff options
Diffstat (limited to '.config/init/funcs/mpd-sleep')
-rwxr-xr-x | .config/init/funcs/mpd-sleep | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.config/init/funcs/mpd-sleep b/.config/init/funcs/mpd-sleep new file mode 100755 index 0000000..c01d734 --- /dev/null +++ b/.config/init/funcs/mpd-sleep @@ -0,0 +1,10 @@ +#!/bin/zsh + +# power off after finishing mpd playlist +mpc play > /dev/null +while true; do + mpc idle player > /dev/null || return 1 + if [[ -z "$(mpc status | grep playing)" ]]; then + poweroff + fi +done |