~abcdw/rde

6d40090ef287a4523fee32d4350b4dcd5fe90f0b — Xinglu Chen 4 months ago 3bb0c92
gnu: home-services: wm: Make XMonad service extend ‘run-on-change’.

* gnu/home-services/wm.scm (xmonad-run-on-change-service): New procedure.
(home-xmonad-service-type): Extend ‘run-hone-change’ service.
1 files changed, 12 insertions(+), 0 deletions(-)

M gnu/home-services/wm.scm
M gnu/home-services/wm.scm => gnu/home-services/wm.scm +12 -0
@@ 223,6 223,15 @@ documentation} for how to configure it."))
            ,(mixed-text-file "xmonad-config"
                              (serialize-text-config #f config))))))))

(define xmonad-run-on-change-service
  (match-lambda
    (($ <home-xmonad-configuration> _ package xmonad-contrib?
                                    xdg-flavor? config)
     #~(#$(if xdg-flavor? "files/config/xmonad/xmonad.hs" "files/xmonad/xmonad.hs")
        (let ((executable #$(file-append package "/bin/xmonad")))
          (system* executable"--recompile")
          (system* executable "--restart"))))))

(define home-xmonad-service-type
  (service-type (name 'home-xmonad)
                (extensions


@@ 231,6 240,9 @@ documentation} for how to configure it."))
                        home-profile-service-type
                        xmonad-profile-service)
                       (service-extension
                        home-run-on-change-service-type
                        xmonad-run-on-change-service)
                       (service-extension
                        home-files-service-type
                        xmonad-files-service)))
                (description "\