Add xbindkeys configuration

This commit is contained in:
Tom Willemse 2022-04-06 23:44:55 -07:00
parent fde6941d93
commit 15b1898664
2 changed files with 51 additions and 2 deletions

View file

@ -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))))

View file

@ -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.")))