From e92af1f7088cc5b6b40a5ceba275a197c305de62 Mon Sep 17 00:00:00 2001
From: katherine <shmibs@shmibbles.me>
Date: Sat, 19 Mar 2016 22:17:28 -0700
Subject: 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
---
 .config/init/funcs/mpd-sleep | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100755 .config/init/funcs/mpd-sleep

(limited to '.config/init/funcs/mpd-sleep')

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
-- 
cgit v1.2.3