From: 宋文武 <iyzsong@gmail.com>
To: guix-devel@gnu.org
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 [thread overview]
Message-ID: <1425824080-350-2-git-send-email-iyzsong@gmail.com> (raw)
In-Reply-To: <1425824080-350-1-git-send-email-iyzsong@gmail.com>
* 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
next prev parent reply other threads:[~2015-03-08 14:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-08 14:14 [PATCH 1/2] services: slim: Use /run/current-system/profile/share/xsessions as sessiondir 宋文武
2015-03-08 14:14 ` 宋文武 [this message]
2015-03-10 8:48 ` [PATCH 2/2] services: slim: Allow non-absolute path to be used as session command Ludovic Courtès
2015-03-10 8:46 ` [PATCH 1/2] services: slim: Use /run/current-system/profile/share/xsessions as sessiondir Ludovic Courtès
2015-03-10 9:20 ` 宋文武
2015-03-12 20:11 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425824080-350-2-git-send-email-iyzsong@gmail.com \
--to=iyzsong@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.