~ruther/guix-exprs

bd3ab166e3b2adf9a7c010496a5c9bbc3b987411 — Rutherther 6 months ago a9b4223
fix: wayland-display services

Except emacs, the services did not actually
need wayland-display, only dbus. For emacs,
wayland-display is required for stuff like xdg-open
to work.
1 files changed, 35 insertions(+), 17 deletions(-)

M ruther/home/services/wayland.scm
M ruther/home/services/wayland.scm => ruther/home/services/wayland.scm +35 -17
@@ 19,6 19,18 @@
            home-waybar-configuration
            home-gammastep-configuration))

(define wayland-display-environ
  #~(begin
      (use-modules (shepherd service)
                   (shepherd support))
      (let* ((display-service (lookup-service 'wayland-display))
           (display (or (and display-service
                             (service-running-value display-service))
                        "FAILED_TO_OBTAIN")))
      (cons (string-append "WAYLAND_DISPLAY=" display)
            (remove (cut string-prefix? "WAYLAND_DISPLAY=" <>)
                    (default-environment-variables))))))

(define (wayland-display-shepherd-service config)
  (list
   (shepherd-service


@@ 26,12 38,8 @@
This should be called from a wayland compositor like this: `herd start wayland-display $WAYLAND_DISPLAY`")
    (provision '(wayland-display))
    (auto-start? #f)
    (start #~(lambda (wayland-display)
               (setenv "WAYLAND_DISPLAY" wayland-display)
               wayland-display))
    (stop #~(lambda (_)
              (unsetenv "WAYLAND_DISPLAY")
              #f)))))
    (start #~(lambda (wayland-display) wayland-display))
    (stop #~(lambda _ #f)))))

(define-public home-wayland-display-service-type
  (service-type


@@ 101,14 109,20 @@ This should be called from a wayland compositor like this: `herd start wayland-d
  (list
   (shepherd-service
    (documentation "Emacs daemon")
    (requirement '(wayland-display))
    (requirement '(wayland-display dbus))
    (provision '(emacs))
    (start #~(make-forkexec-constructor
              (cons* #$(file-append
                        (home-emacs-configuration-emacs config)
                        "/bin/emacs")
                     "--fg-daemon"
                     '#$(home-emacs-configuration-extra-arguments config))))
    (auto-start? #f)
    (modules '((srfi srfi-1)
               (srfi srfi-26)
               (shepherd service)
               (shepherd support)))
    (start #~(lambda _
               (fork+exec-command
                (cons*
                 #$(file-append (home-emacs-configuration-emacs config) "/bin/emacs")
                 "--fg-daemon"
                 '#$(home-emacs-configuration-extra-arguments config))
                #:environment-variables #$wayland-display-environ)))
    (stop #~(make-kill-destructor)))))

(define-public home-emacs-service-type


@@ 130,8 144,9 @@ This should be called from a wayland compositor like this: `herd start wayland-d
  (list
   (shepherd-service
    (documentation "Network Manager Applet daemon")
    (requirement '(wayland-display))
    (requirement '(dbus))
    (provision '(network-manager-applet))
    (auto-start? #f)
    (start #~(make-forkexec-constructor
              (cons* #$(file-append
                        (home-network-manager-applet-configuration-network-manager-applet config)


@@ 161,8 176,9 @@ ie. to get manager running when applet is clicked on.")
  (list
   (shepherd-service
    (documentation "Blueman applet daemon")
    (requirement '(wayland-display))
    (requirement '(dbus))
    (provision '(blueman-applet))
    (auto-start? #f)
    (start #~(make-forkexec-constructor
              (cons* #$(file-append
                        (home-blueman-applet-configuration-blueman config)


@@ 196,8 212,9 @@ ie. to get manager running when applet is clicked on.")
  (list
   (shepherd-service
    (documentation "Waybar daemon")
    (requirement '(wayland-display))
    (requirement '(dbus))
    (provision '(waybar))
    (auto-start? #f)
    (start #~(make-forkexec-constructor
              (cons* #$(file-append
                        (home-waybar-configuration-waybar config)


@@ 225,8 242,9 @@ ie. to get manager running when applet is clicked on.")
  (list
   (shepherd-service
    (documentation "Gammastep daemon")
    (requirement '(wayland-display))
    (requirement '(dbus))
    (provision '(gammastep))
    (auto-start? #f)
    (start #~(make-forkexec-constructor
              (cons* #$(file-append
                        (home-gammastep-configuration-gammastep config)

Do not follow this link