summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorTimothy Sample <samplet@ngyro.com>2019-04-26 13:45:36 -0400
committerTimothy Sample <samplet@ngyro.com>2019-04-26 13:57:39 -0400
commit8caa458953eeac783c73a0e5aaa72842fe3914c9 (patch)
treeb37959868c26d68ca7b859cc9e49bf3ab173e488 /gnu/packages
parent8597aecb848c95e21bda789daf40bceaaa5ee87f (diff)
downloadguix-8caa458953eeac783c73a0e5aaa72842fe3914c9.tar.gz
gnu: gdm: Install a placeholder desktop entry.
This fixes <https://bugs.gnu.org/35068>.

* gnu/packages/gnome.scm (gdm)[arguments]: Add a phase that installs a
placeholder desktop entry file.

Co-authored-by: Danny Milosavljevic <dannym@scratchpost.org>
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/gnome.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 101c0ce13f..34a9af21f9 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5536,6 +5537,29 @@ libxml2.")
                (string-append "\"" (assoc-ref inputs "gnome-session")
                               "/bin/gnome-session\"")))
             #t))
+         ;; GDM requires that there be at least one desktop entry
+         ;; file.  This phase installs a hidden one that simply
+         ;; fails.  This enables users to use GDM with a
+         ;; '~/.xsession' script with no other desktop entry files.
+         ;; See <https://bugs.gnu.org/35068>.
+         (add-after 'install 'install-placeholder-desktop-entry
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (sessions (string-append out "/share/gdm/BuiltInSessions"))
+                    (fail (string-append sessions "/fail.desktop")))
+               (mkdir-p sessions)
+               (with-output-to-file fail
+                 (lambda ()
+                   (for-each
+                    display
+                    '("[Desktop Entry]\n"
+                      "Encoding=UTF-8\n"
+                      "Type=Application\n"
+                      "Name=Fail\n"
+                      "Comment=This session fails immediately.\n"
+                      "NoDisplay=true\n"
+                      "Exec=false\n"))))
+               #t)))
          ;; GDM needs GNOME Session to run these applications.  We link
          ;; their autostart files in `share/gdm/greeter/autostart'
          ;; because GDM explicitly tells GNOME Session to look there.