diff --git a/oni/home/services/xmodmap.scm b/oni/home/services/xmodmap.scm index e6e5562..a4dacde 100644 --- a/oni/home/services/xmodmap.scm +++ b/oni/home/services/xmodmap.scm @@ -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.")))