Use shepherd to start xmodmap rather than on first startup
This commit is contained in:
parent
13baec4666
commit
00f51af69d
1 changed files with 14 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
|||
#:use-module (gnu services configuration)
|
||||
#:use-module (gnu packages xorg)
|
||||
#:use-module (gnu home services)
|
||||
#:use-module (gnu home services shepherd)
|
||||
#:use-module (gnu home services utils)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix gexp)
|
||||
|
@ -39,12 +40,17 @@
|
|||
(define (add-xmodmap-packages config)
|
||||
(list (home-xmodmap-configuration-package config)))
|
||||
|
||||
(define (launch-xmodmap-gexp config)
|
||||
(let ((xmodmap (home-xmodmap-configuration-package config)))
|
||||
(if (home-xmodmap-configuration-auto-start? config)
|
||||
#~(system* #$(file-append xmodmap "/bin/xmodmap")
|
||||
#$(xmodmap-home-config-file config))
|
||||
#~"")))
|
||||
(define (home-xmodmap-shepherd-service config)
|
||||
(list
|
||||
(shepherd-service
|
||||
(documentation "Start Xmodmap")
|
||||
(provision '(xmodmap))
|
||||
(auto-start? (home-xmodmap-configuration-auto-start? config))
|
||||
(one-shot? #t)
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
'(#$(file-append xmodmap "/bin/xmodmap")
|
||||
#$(xmodmap-home-config-file config)))))))
|
||||
|
||||
(define home-xmodmap-service-type
|
||||
(service-type
|
||||
|
@ -54,8 +60,8 @@
|
|||
home-profile-service-type
|
||||
add-xmodmap-packages)
|
||||
(service-extension
|
||||
home-run-on-first-login-service-type
|
||||
launch-xmodmap-gexp)))
|
||||
home-shepherd-service-type
|
||||
home-xmodmap-shepherd-service)))
|
||||
(compose identity)
|
||||
(default-value (home-xmodmap-configuration))
|
||||
(description "Install and configure Xmodmap.")))
|
||||
|
|
Loading…
Reference in a new issue