diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2021-01-14 17:30:29 +0100 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2021-01-14 17:30:29 +0100 |
commit | c0b5058b78438f52d9593e97b031fc6272c2f674 (patch) | |
tree | c204f9c9c7a6e4ae12ed3ed2ba36072cef1303dc /shepherd | |
parent | 5e995529f7b522452ff1c6798c7a0ff3d0bf4c3c (diff) |
configure user-level shepherd for redshift
Diffstat (limited to 'shepherd')
-rw-r--r-- | shepherd/shepherd/init.d/redshift.scm | 16 | ||||
-rw-r--r-- | shepherd/shepherd/init.scm | 19 |
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 '()) |