diff --git a/oni/home/data/config.scm b/oni/home/data/config.scm index 7f47da0..070f4c2 100644 --- a/oni/home/data/config.scm +++ b/oni/home/data/config.scm @@ -12,7 +12,8 @@ #:use-module (oni home services xmodmap) #:use-module (oni home services kitty) #:use-module (oni home services xsession) - #:use-module (oni home services compton)) + #:use-module (oni home services compton) + #:use-module (oni home services xbindkeys)) (home-environment (packages (list (specification->package+output "glibc-locales") @@ -231,4 +232,6 @@ (shadow-radius . 10) (shadow-exclude ("name = 'mowedline'" "class_g = 'trayer'" - "bounding_shaped"))))))))) + "bounding_shaped")))))) + + (service home-xbindkeys-service-type)))) diff --git a/oni/home/services/xbindkeys.scm b/oni/home/services/xbindkeys.scm new file mode 100644 index 0000000..e832a07 --- /dev/null +++ b/oni/home/services/xbindkeys.scm @@ -0,0 +1,46 @@ +(define-module (oni home services xbindkeys) + #:use-module (gnu services configuration) + #:use-module (gnu packages xdisorg) + #: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) + + #:export (home-xbindkeys-service-type + home-xbindkeys-configuration)) + +(define-configuration/no-serialization home-xbindkeys-configuration + (package + (package xbindkeys) + "Package to use for setting xbindkeys")) + +(define (add-xbindkeys-packages config) + (list (home-xbindkeys-configuration-package config))) + +(define (home-xbindkeys-shepherd-service config) + (list + (shepherd-service + (documentation "Start xbindkeys") + (provision '(xbindkeys)) + (auto-start? #t) + (start + #~(make-forkexec-constructor + (list #$(file-append (home-xbindkeys-configuration-package config) "/bin/xbindkeys") + "--nodaemon") + #:log-file (format #f "~a/.local/var/log/xbindkeys.scm" (getenv "HOME")))) + (stop #~(make-kill-destructor))))) + +(define home-xbindkeys-service-type + (service-type + (name 'home-xbindkeys) + (extensions + (list (service-extension + home-profile-service-type + add-xbindkeys-packages) + (service-extension + home-shepherd-service-type + home-xbindkeys-shepherd-service))) + (compose identity) + (default-value (home-xbindkeys-configuration)) + (description "Install and configure xbindkeys.")))