dotfiles/oni/home/services/xbindkeys.scm

46 lines
1.5 KiB
Scheme

(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.log" (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.")))