Make picom restart automatically when the coonfiguration changes

This commit is contained in:
Tom Willemse 2023-03-16 23:09:54 -07:00
parent 9059cec94c
commit 300c22cb56

View file

@ -6,11 +6,14 @@
serialize-package))
#:use-module ((gnu packages compton)
#:select (picom))
#:use-module ((gnu packages admin)
#:select (shepherd))
#:use-module ((gnu home services)
#:select (home-profile-service-type
home-xdg-configuration-files-service-type
service-extension
service-type))
service-type
home-run-on-change-service-type))
#:use-module ((gnu home services shepherd)
#:select (home-shepherd-service-type
shepherd-service))
@ -183,6 +186,10 @@
#:log-file (format #f "~a/.local/var/log/picom.log" (getenv "HOME"))))
(stop #~(make-kill-destructor)))))
(define (restart-picom-gexp _)
`(("files/.config/picom.conf"
,#~(system* #$(file-append shepherd "/bin/herd") "restart" "picom"))))
(define home-picom-service-type
(service-type (name 'home-picom)
(extensions
@ -194,7 +201,10 @@
home-picom-profile-service)
(service-extension
home-shepherd-service-type
home-picom-shepherd-service)))
home-picom-shepherd-service)
(service-extension
home-run-on-change-service-type
restart-picom-gexp)))
(compose concatenate)
(default-value (home-picom-configuration))
(description "Configure Picom")))