summaryrefslogtreecommitdiff
path: root/shepherd
diff options
context:
space:
mode:
Diffstat (limited to 'shepherd')
-rw-r--r--shepherd/shepherd/init.d/redshift.scm16
-rw-r--r--shepherd/shepherd/init.scm19
2 files changed, 25 insertions, 10 deletions
diff --git a/shepherd/shepherd/init.d/redshift.scm b/shepherd/shepherd/init.d/redshift.scm
new file mode 100644
index 0000000..d17474f
--- /dev/null
+++ b/shepherd/shepherd/init.d/redshift.scm
@@ -0,0 +1,16 @@
+(define redshift
+ (make <service>
+ #:provides '(redshift)
+ #:docstring "Redshift adjusts the color temperature of your screen
+ according to your surroundings. This may help your eyes hurt less if you are
+ working in front of the screen at night."
+ #:start (make-forkexec-constructor '("redshift")
+ #:log-file (string-append
+ (or (getenv "XDG_CONFIG_HOME")
+ (string-append (getenv "HOME") "/.config"))
+ "/redshift/redshift.log"))
+ #:stop (make-kill-destructor)
+ #:respawn? #t))
+(register-services redshift)
+
+(start redshift)
diff --git a/shepherd/shepherd/init.scm b/shepherd/shepherd/init.scm
index 8ef2166..126684b 100644
--- a/shepherd/shepherd/init.scm
+++ b/shepherd/shepherd/init.scm
@@ -1,14 +1,13 @@
-;; init.scm -- default shepherd configuration file.
+(use-modules (shepherd service)
+ ((ice-9 ftw) #:select (scandir)))
-;; Services known to shepherd:
-;; Add new services (defined using 'make <service>') to shepherd here by
-;; providing them as arguments to 'register-services'.
-(register-services)
+;; Load all the files in the directory 'init.d' with a suffix '.scm'.
+(for-each
+ (lambda (file)
+ (load (string-append "init.d/" file)))
+ (scandir (string-append (dirname (current-filename)) "/init.d")
+ (lambda (file)
+ (string-suffix? ".scm" file))))
;; Send shepherd into the background
(action 'shepherd 'daemonize)
-
-;; Services to start when shepherd starts:
-;; Add the name of each service that should be started to the list
-;; below passed to 'for-each'.
-(for-each start '())