2022-04-07 08:44:55 +02:00
|
|
|
(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")
|
2022-04-16 09:23:33 +02:00
|
|
|
#:log-file (format #f "~a/.local/var/log/xbindkeys.log" (getenv "HOME"))))
|
2022-04-07 08:44:55 +02:00
|
|
|
(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.")))
|