Last active
December 26, 2015 04:39
-
-
Save sherbondy/7094713 to your computer and use it in GitHub Desktop.
Flux as a daemon (had trouble getting the gui to work on debian wheezy)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: xflux | |
# Required-Start: $all | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Initialize flux on launch | |
# Description: Flux helps you to avoid eye and disrupted sleep patterns strain by adjusting your display colors based on time of day. | |
### END INIT INFO | |
# | |
#Daemonized flux for my zip code | |
# | |
ZIP=02139 | |
PID=$(pgrep "xflux"| head -n 1) | |
case "$1" in | |
start|"") | |
if [ -z "$PID" ] | |
then | |
xflux -z $ZIP | |
else | |
echo "flux is already running: $PID" | |
fi | |
;; | |
stop) | |
if [ -z "$PID" ] | |
then | |
echo "flux is not running." | |
else | |
kill $PID | |
fi | |
;; | |
*) | |
echo "Usage: xflux.sh [start|stop]" | |
exit 3 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment