From 3b258d374043b476a5dba2d84d4ffb21b8e9b3bd Mon Sep 17 00:00:00 2001 From: Sisiutl Date: Sun, 1 Dec 2024 09:10:50 +0100 Subject: hyprpaper shepherd --- sigils/home/services/hyprland.scm | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'sigils') diff --git a/sigils/home/services/hyprland.scm b/sigils/home/services/hyprland.scm index 874b875..469c319 100644 --- a/sigils/home/services/hyprland.scm +++ b/sigils/home/services/hyprland.scm @@ -300,7 +300,6 @@ with wayland display ~s.~%" hyprland-instance wayland-display) (unsetenv "WAYLAND_DISPLAY") #f))))) - (define home-hyprland-service-type (service-type (name 'home-hyprland) @@ -335,6 +334,25 @@ with wayland display ~s.~%" hyprland-instance wayland-display) (serialize-hypr-config (home-hyprpaper-configuration-config config)))))) +(define (hyprpaper-shepherd-service config) + (let ((hyprpaper (home-hyprpaper-configuration-hyprpaper config))) + (list (shepherd-service + (provision '(hyprpaper)) + (modules '((srfi srfi-1) + (srfi srfi-26))) + (start #~(lambda _ + (fork+exec-command + (list #$(file-append hyprpaper "/bin/hyprpaper")) + #:log-file (string-append + (getenv "XDG_STATE_HOME") "/log" + "/hyprpaper.log") + #:environment-variables + (cons (string-append "WAYLAND_DISPLAY=" (getenv "WAYLAND_DISPLAY")) + (remove (cut string-prefix? "WAYLAND_DISPLAY=" <>) + (default-environment-variables)))))) + (stop #~(make-kill-destructor)) + (documentation "Start hyprpaper"))))) + (define home-hyprpaper-service-type (service-type (name 'home-hyprpaper) @@ -345,7 +363,10 @@ with wayland display ~s.~%" hyprland-instance wayland-display) (service-extension home-profile-service-type (lambda (config) - (list (home-hyprpaper-configuration-hyprpaper config)))))) + (list (home-hyprpaper-configuration-hyprpaper config)))) + (service-extension + home-shepherd-service-type + hyprpaper-shepherd-service))) (compose identity) (default-value (home-hyprpaper-configuration)) (description "Configure Hyprpaper by providing @file{~/.config/hypr/hyprpaper.conf}."))) -- cgit v1.2.3