From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Subject: [PATCH 2/2] services: slim: Allow non-absolute path to be used as session command. Date: Sun, 8 Mar 2015 22:14:40 +0800 Message-ID: <1425824080-350-2-git-send-email-iyzsong@gmail.com> References: <1425824080-350-1-git-send-email-iyzsong@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUbyt-0001Aw-Pa for guix-devel@gnu.org; Sun, 08 Mar 2015 10:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUbys-0005mp-F6 for guix-devel@gnu.org; Sun, 08 Mar 2015 10:14:59 -0400 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]:43545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUbys-0005mh-7R for guix-devel@gnu.org; Sun, 08 Mar 2015 10:14:58 -0400 Received: by pablj1 with SMTP id lj1so56540008pab.10 for ; Sun, 08 Mar 2015 07:14:57 -0700 (PDT) In-Reply-To: <1425824080-350-1-git-send-email-iyzsong@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * 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