Subject: [bug#76153] [PATCH v3] gnu: icewm: Add icewm.desktop file. patch originally written by 白い熊 ShiroiKuma retrieved from https://lists.nongnu.org/archive/html/help-guix/2022-05/msg00114.html

From: Andy Tai <[email-masked]>
Date: Sat, 1 Mar 2025 21:41:22 -0800

* gnu/packages/wm.scm (icewm): Add 'install-xsession phase that
installs the icewm.desktop.file so icewm can be a choice as a desktop
in gdm (the graphical login screen)

Change-Id: I94661ec15bccc3bcb1539a52c78cc303a4b5caf3
---
 gnu/packages/wm.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index ca79e39c57..126f71ddee 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -1065,7 +1065,26 @@ (define-public icewm
                  (lambda _
                    (substitute* "src/Makefile.in"
                      (("TESTS = strtest\\$\\(EXEEXT\\)")
-                      "TESTS = ")))))))
+                      "TESTS = "))))
+                   (add-after 'install '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)
+                         (call-with-output-file (string-append xsessions
+
+                                                 "/icewm.desktop")
+                           (lambda (port)
+                             (format port
+                              "[Desktop Entry]~@
+                            Name=icewm~@
+                            Comment=IceWM window manager~@
+                            Exec=~a/bin/icewm~@
+                            TryExec=~@*~a/bin/icewm~@
+                            Type=Application~%"
+                              output)))))))))
     (home-page "https://ice-wm.org/")
     (synopsis "Window manager for the X Window System")
     (description

base-commit: f9dcb84550b85aa816899b2106b1a5ae546167a3
-- 
2.43.0