From 300c22cb56e5199e7bd6273ab8e06dc39e800659 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 16 Mar 2023 23:09:54 -0700 Subject: [PATCH] Make picom restart automatically when the coonfiguration changes --- oni/home/services/picom.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/oni/home/services/picom.scm b/oni/home/services/picom.scm index 28dde71..c195c3a 100644 --- a/oni/home/services/picom.scm +++ b/oni/home/services/picom.scm @@ -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")))