aboutsummaryrefslogtreecommitdiffstats
path: root/.config/init/funcs/mpd-sleep
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2016-03-19 22:17:28 -0700
committerkatherine <shmibs@shmibbles.me>2016-03-19 22:17:28 -0700
commite92af1f7088cc5b6b40a5ceba275a197c305de62 (patch)
tree5d92832f1ecdaff44ca61a15f3c3d11b49fb2d79 /.config/init/funcs/mpd-sleep
parentb351865a2b3678708d70c6e088c70ae8f7fd923f (diff)
downloaddotfiles-e92af1f7088cc5b6b40a5ceba275a197c305de62.tar.gz
snapshot
lots of random things changed; forgot to update for a while again. moving things to .config/init/funcs is one important thing; means being able to use those shell scripts anywhere, like ranger or whatever
Diffstat (limited to '.config/init/funcs/mpd-sleep')
-rwxr-xr-x.config/init/funcs/mpd-sleep10
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