Adding an xsession to guile-wm so that display managers will identify it
as an available wm.
From 91f74b1b762596527dfa9412c33e39981932fa70 Mon Sep 17 00:00:00 2001
From: Alex ter Weele <alex.ter.we...@gmail.com>
Date: Sun, 11 Sep 2016 22:18:53 -0400
Subject: [PATCH] Adding .xsession to guile-wm

---
 gnu/packages/guile-wm.scm | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 98e657f..606a792 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -64,6 +64,7 @@ dependencies.")
   (package
     (name "guile-wm")
     (version "1.0")
+    (synopsis "Guile window manager")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://www.markwitmer.com/dist/guile-wm-";
@@ -72,7 +73,7 @@ dependencies.")
                (base32
                 "1l9qcz236jxvryndimjy62cf8zxf8i3f8vg3zpqqjhw15j9mdk3r"))))
     (build-system gnu-build-system)
-    (arguments '(;; The '.scm' files go to $(datadir), so set that to the
+    (arguments `(;; The '.scm' files go to $(datadir), so set that to the
                  ;; standard value.
                  #:configure-flags (list (string-append "--datadir="
                                           (assoc-ref %outputs "out")
@@ -103,7 +104,27 @@ dependencies.")
                                  `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb))
                                  `("GUILE_LOAD_COMPILED_PATH" ":" prefix
                                    (,mods ,xcb)))))
-                            %standard-phases))))
+                            (alist-cons-after
+                             'install 'install-xsession
+                             (lambda* (#:key outputs #:allow-other-keys)
+                               ;; add a .desktop file to xsessions
+                               (let ((xsessions (string-append
+                                                 %output "/share/xsessions")))
+                                 (mkdir-p xsessions)
+                                 (call-with-output-file
+                                     (string-append
+                                      xsessions "/guile-wm.desktop")
+                                   (lambda (port)
+                                     (format
+                                      port
+                                      "~
+                                       [Desktop Entry]~@
+                                       Name=~a~@
+                                       Comment=~a~@
+                                       Exec=~a/bin/guile-wm~@
+                                       Type=Application~%"
+                                      ,name ,synopsis %output)))))
+                             %standard-phases)))))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("guile" ,guile-2.0)
               ("guile-xcb" ,guile-xcb)))
-- 
2.10.0

Reply via email to