summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSisiutl <sisiutl@egregore.fun>2025-08-29 14:39:03 +0200
committerSisiutl <sisiutl@egregore.fun>2025-08-29 14:39:03 +0200
commit40511f2f272ef714196393e7b4d6c8180332421f (patch)
treec83642e59ad4797bd7cd87f587c4b878dcb6d95d
parent4d15d5d54643797d7727c04f79c0471c2e6f37c3 (diff)
use fork+exec for swww instances
-rw-r--r--sigils/home/services/wayland.scm29
1 files changed, 20 insertions, 9 deletions
diff --git a/sigils/home/services/wayland.scm b/sigils/home/services/wayland.scm
index a80a5bd..11a8805 100644
--- a/sigils/home/services/wayland.scm
+++ b/sigils/home/services/wayland.scm
@@ -180,7 +180,8 @@ Install and configure kanshi, output profile manager.")))
(getenv "XDG_STATE_HOME") "/log"
"/swww.log")
#:environment-variables
- (cons (string-append "WAYLAND_DISPLAY=" (getenv "WAYLAND_DISPLAY"))
+ (cons (string-append "WAYLAND_DISPLAY="
+ (getenv "WAYLAND_DISPLAY"))
(remove (cut string-prefix? "WAYLAND_DISPLAY=" <>)
(default-environment-variables))))))
(stop #~(make-kill-destructor))
@@ -192,17 +193,27 @@ Install and configure kanshi, output profile manager.")))
(requirement '(swww))
(one-shot? #t)
(start
- #~(make-forkexec-constructor
- (append
- (list
- #$(file-append swww "/bin/swww") "img"
- #$(swww-wallpaper-img wallpaper)
- #$@(let ((output (swww-wallpaper-output wallpaper)))
- (if output (list "-o" output) '()))))))
+ #~(lambda _
+ ;; This is not optimal.
+ (fork+exec-command
+ (append
+ (list
+ #$(file-append swww "/bin/swww") "img"
+ #$(swww-wallpaper-img wallpaper)
+ #$@(let ((output (swww-wallpaper-output wallpaper)))
+ (if output (list "-o" output) '()))))
+ #:log-file (format #f "~a/log/swww-~a.log"
+ (getenv "XDG_STATE_HOME") i)
+ #:environment-variables
+ (cons (string-append "WAYLAND_DISPLAY="
+ (getenv "WAYLAND_DISPLAY"))
+ (remove (cut string-prefix? "WAYLAND_DISPLAY=" <>)
+ (default-environment-variables))))))
(stop #~(make-kill-destructor))
(documentation "Set the wallpapers for Swww.")))
(receive (with-outputs without-outputs)
- (partition swww-wallpaper-output (home-swww-configuration-wallpapers config))
+ (partition swww-wallpaper-output
+ (home-swww-configuration-wallpapers config))
(append without-outputs with-outputs))
(iota (length (home-swww-configuration-wallpapers config)) 1)))))