]> git.wh0rd.org Git - home.git/commitdiff
add redshift-check helper
authorMike Frysinger <vapier@gentoo.org>
Fri, 7 Feb 2014 04:37:36 +0000 (23:37 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 7 Feb 2014 04:37:36 +0000 (23:37 -0500)
.bin/redshift-check [new file with mode: 0755]

diff --git a/.bin/redshift-check b/.bin/redshift-check
new file mode 100755 (executable)
index 0000000..f8f2ca8
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+h=$(date +%H)
+if [ ${h#0} -lt 10 -o ${h#0} -ge 21 ]; then
+       (pgrep redshift >/dev/null 2>&1 || DISPLAY=:0 redshift) &
+else
+       killall -q redshift
+fi
+: