summaryrefslogtreecommitdiff
path: root/sigils/home/services
diff options
context:
space:
mode:
authorSisiutl <sisiutl@egregore.fun>2024-12-01 09:10:50 +0100
committerSisiutl <sisiutl@egregore.fun>2024-12-02 09:40:24 +0100
commit3b258d374043b476a5dba2d84d4ffb21b8e9b3bd (patch)
treeb355d1d23ccb13695cd12722d3aee8d63b4c76b0 /sigils/home/services
parentda2ba1b875192585bb0d3e79c17eada0af7640d6 (diff)
hyprpaper shepherd
Diffstat (limited to 'sigils/home/services')
-rw-r--r--sigils/home/services/hyprland.scm25
1 files changed, 23 insertions, 2 deletions
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}.")))