Skip to content

Instantly share code, notes, and snippets.

@flavianmissi
Created February 25, 2016 17:12
Show Gist options
  • Save flavianmissi/88a530e9f30eff465e07 to your computer and use it in GitHub Desktop.
Save flavianmissi/88a530e9f30eff465e07 to your computer and use it in GitHub Desktop.
Redshift (adjusts the color temperature of your screen according to your location) initialization scripts for my current location
#!/bin/sh
#/etc/init.d/redshift
set -e
. /lib/lsb/init-functions
BASE=$(basename $0)
REDSHIFT=/usr/bin/$BASE
REDSHIFT_PIDFILE=/var/run/$BASE.pid
case "$1" in
start)
log_begin_msg "Starting $BASE"
exec "$REDSHIFT" -l 55.6049810:13.0038220 # location is Malmö/SE
log_end_msg $?
;;
stop)
log_begin_msg "Stopping $BASE"
killall $BASE
;;
restart)
log_begin_msg "Restarting redshift"
killall $BASE
exec "$REDSHIFT" -l 55.6049810:13.0038220 # location is Malmö/SE
;;
esac
description "redshift daemon"
#/etc/init/redshift.conf
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
limit nofile 524288 1048576
limit nproc 524288 1048576
respawn
script
REDSHIFT=/usr/bin/redshift
exec "$REDSHIFT" -l 55.6049810:13.0038220 # location is Malmö/SE
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment