* gnu/services/xorg.scm (xinitrc)[builder]: Don't check the existence
  of COMMAND.  Only run ~/.xsession when it exists.
---
 gnu/services/xorg.scm | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 912cbd3..a6bebf1 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -158,24 +158,23 @@ which should be passed to this script as the first 
argument.  If not, the
           ;; environment variables that one gets when logging in on a tty, for
           ;; instance.
           (let* ((pw    (getpw (getuid)))
-                 (shell (passwd:shell pw))
-                 (st    (stat command #f)))
-            (when (and st (not (zero? (logand (stat:mode st) #o100))))
-              ;; Close any open file descriptors.  This is all the more
-              ;; important that SLiM itself exec's us directly without closing
-              ;; its own file descriptors!
-              (close-all-fdes)
+                 (shell (passwd:shell pw)))
+            ;; Close any open file descriptors.  This is all the more
+            ;; important that SLiM itself exec's us directly without closing
+            ;; its own file descriptors!
+            (close-all-fdes)
 
-              ;; The '--login' option is supported at least by Bash and zsh.
-              (execl shell shell "--login" "-c"
-                     (string-join (cons command args))))))
+            ;; The '--login' option is supported at least by Bash and zsh.
+            (execl shell shell "--login" "-c"
+                   (string-join (cons command args)))))
 
         (let ((home (getenv "HOME"))
               (session (match (command-line)
                          ((_ x) x)
                          (_     #$fallback-session))))
-          ;; First, try to run ~/.xsession.
-          (exec-from-login-shell (string-append home "/.xsession"))
+          ;; First, try to run ~/.xsession when it exists.
+          (when (file-exists? "~/.xsession")
+            (exec-from-login-shell (string-append home "/.xsession")))
           ;; Then try to start the specified session.
           (exec-from-login-shell session))))
   (gexp->script "xinitrc" builder))
-- 
2.2.1


Reply via email to