summaryrefslogtreecommitdiff
path: root/gnu/services/xorg.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/services/xorg.scm')
-rw-r--r--gnu/services/xorg.scm20
1 files changed, 15 insertions, 5 deletions
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 7ca0d3f7db..a34129a8ed 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -97,7 +97,12 @@ EndSection
#~(begin
(use-modules (ice-9 match))
- ;; TODO: Check for ~/.xsession.
+ ;; First, try to run ~/.xsession.
+ (let* ((home (getenv "HOME"))
+ (file (string-append home "/.xsession")))
+ (false-if-exception (execl file file)))
+
+ ;; Then try a pre-configured session type.
(match (command-line)
((_ "ratpoison")
(execl (string-append #$ratpoison "/bin/ratpoison")))
@@ -146,10 +151,15 @@ reboot_cmd " dmd "/sbin/reboot
(provision '(xorg-server))
(requirement '(user-processes host-name udev))
(start
- #~(make-forkexec-constructor
- (list (string-append #$slim "/bin/slim") "-nodaemon")
- #:environment-variables
- (list (string-append "SLIM_CFGFILE=" #$slim.cfg))))
+ #~(lambda ()
+ ;; A stale lock file can prevent SLiM from starting, so remove it
+ ;; to be on the safe side.
+ (false-if-exception (delete-file "/var/run/slim.lock"))
+
+ (fork+exec-command
+ (list (string-append #$slim "/bin/slim") "-nodaemon")
+ #:environment-variables
+ (list (string-append "SLIM_CFGFILE=" #$slim.cfg)))))
(stop #~(make-kill-destructor))
(respawn? #t)
(pam-services