mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-31 06:46:50 +01:00
home: services: unclutter: Inherit $DISPLAY.
* gnu/home/services/desktop.scm: Add DISPLAY to the list of environment variables passed to 'home-unclutter-service-type'. Change 'make-forkexec-construstor' to 'fork+exec-command' as the former did not seem to pick up the newly defined environment variable. Add 'x11-display' as a requirement. These changes are consistent to how things are done in 'home-redshift-service-type'. Change-Id: Ie8b88b30353e76139d354da27aef791036eaa5a0 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
8ff33c398a
commit
b0e3121495
1 changed files with 24 additions and 14 deletions
|
@ -349,21 +349,31 @@ (define (home-unclutter-shepherd-service config)
|
||||||
(list
|
(list
|
||||||
(shepherd-service
|
(shepherd-service
|
||||||
(provision '(unclutter))
|
(provision '(unclutter))
|
||||||
(requirement '())
|
;; Depend on 'x11-display', which sets 'DISPLAY' if an X11 server is
|
||||||
|
;; available, and fails to start otherwise.
|
||||||
|
(requirement '(x11-display))
|
||||||
|
(modules '((srfi srfi-1)
|
||||||
|
(srfi srfi-26)))
|
||||||
(one-shot? #t)
|
(one-shot? #t)
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(lambda _
|
||||||
(list
|
(fork+exec-command
|
||||||
#$(file-append
|
(list
|
||||||
(home-unclutter-configuration-unclutter config)
|
#$(file-append
|
||||||
"/bin/unclutter")
|
(home-unclutter-configuration-unclutter config)
|
||||||
"-idle"
|
"/bin/unclutter")
|
||||||
(number->string
|
"-idle"
|
||||||
#$(home-unclutter-configuration-idle-timeout config)))
|
(number->string
|
||||||
#:log-file (string-append
|
#$(home-unclutter-configuration-idle-timeout config)))
|
||||||
(or (getenv "XDG_STATE_HOME")
|
;; Inherit the 'DISPLAY' variable set by 'x11-display'.
|
||||||
(format #f "~a/.local/state"
|
#:environment-variables
|
||||||
(getenv "HOME")))
|
(cons (string-append "DISPLAY=" (getenv "DISPLAY"))
|
||||||
"/log/unclutter.log"))))))
|
(remove (cut string-prefix? "DISPLAY=" <>)
|
||||||
|
(default-environment-variables)))
|
||||||
|
#:log-file (string-append
|
||||||
|
(or (getenv "XDG_STATE_HOME")
|
||||||
|
(format #f "~a/.local/state"
|
||||||
|
(getenv "HOME")))
|
||||||
|
"/log/unclutter.log")))))))
|
||||||
|
|
||||||
(define home-unclutter-service-type
|
(define home-unclutter-service-type
|
||||||
(service-type
|
(service-type
|
||||||
|
|
Loading…
Reference in a new issue