summary refs log tree commit diff
path: root/gnu/packages/suckless.scm
diff options
context:
space:
mode:
authorng0 <ng0@libertad.pw>2017-01-15 12:21:16 +0000
committerLudovic Courtès <ludo@gnu.org>2017-01-16 11:03:46 +0100
commitad1c349db067fc8d035a05ace39d22d0125e8f85 (patch)
tree0c5e7c4176494106651c1c876a96d85825ec34b3 /gnu/packages/suckless.scm
parent0d2c8f342017eab4f5c542e53a9179acaf6b507f (diff)
downloadguix-ad1c349db067fc8d035a05ace39d22d0125e8f85.tar.gz
gnu: dwm: Add '.desktop' file.
Fixes <https://bugs.gnu.org/25438>.

* gnu/packages/suckless.scm (dwm)[arguments]: Add
'install-xsession' phase.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/suckless.scm')
-rw-r--r--gnu/packages/suckless.scm21
1 files changed, 20 insertions, 1 deletions
diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index a737a29dc0..e30a0883a3 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -74,7 +74,26 @@
             (let ((out (assoc-ref outputs "out")))
               (zero?
                (system* "make" "install"
-                        (string-append "DESTDIR=" out) "PREFIX="))))))))
+                        (string-append "DESTDIR=" out) "PREFIX=")))))
+        (add-after 'build 'install-xsession
+          (lambda* (#:key outputs #:allow-other-keys)
+            ;; Add a .desktop file to xsessions.
+            (let* ((output (assoc-ref outputs "out"))
+                   (xsessions (string-append output "/share/xsessions")))
+              (mkdir-p xsessions)
+              (with-output-to-file
+                  (string-append xsessions "/dwm.desktop")
+                (lambda _
+                  (format #t
+                    "[Desktop Entry]~@
+                     Name=dwm~@
+                     Comment=Dynamic Window Manager~@
+                     Exec=~a/bin/dwm~@
+                     TryExec=~@*~a/bin/dwm~@
+                     Icon=~@
+                     Type=Application~%"
+                    output)))
+              #t))))))
     (inputs
      `(("freetype" ,freetype)
        ("libx11" ,libx11)