guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: services: slim: Allow non-absolute path to be used as session com


From: ???
Subject: 02/03: services: slim: Allow non-absolute path to be used as session command.
Date: Fri, 13 Mar 2015 14:58:32 +0000

iyzsong pushed a commit to branch master
in repository guix.

commit e0b85670cf29899edb0c23477301e10bb43831ef
Author: 宋文武 <address@hidden>
Date:   Sun Mar 8 20:57:53 2015 +0800

    services: slim: Allow non-absolute path to be used as session command.
    
    * gnu/services/xorg.scm (xinitrc)[builder]: Don't check the existence
      of COMMAND.  Only run ~/.xsession when it exists.
---
 gnu/services/xorg.scm |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 912cbd3..14edf8c 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -158,26 +158,26 @@ 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"))
-          ;; Then try to start the specified session.
-          (exec-from-login-shell session))))
+        (let* ((home          (getenv "HOME"))
+               (xsession-file (string-append home "/.xsession"))
+               (session       (match (command-line)
+                                ((_ x) x)
+                                (_     #$fallback-session))))
+          (if (file-exists? xsession-file)
+              ;; Run ~/.xsession when it exists.
+              (exec-from-login-shell xsession-file)
+              ;; Otherwise, start the specified session.
+              (exec-from-login-shell session)))))
   (gexp->script "xinitrc" builder))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]