summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-12 22:29:41 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-12 23:30:51 +0200
commit33af3abda8dcb4f259ec6bbbc8d40bc997d9e4d4 (patch)
tree422553df4adc2bc7560c5d516afaaecf6f3a4d04
parent6ce2946ab91f7f8b1a37b54a92351d1f0980d27d (diff)
downloaddotfiles-33af3abda8dcb4f259ec6bbbc8d40bc997d9e4d4.tar.gz
dotfiles-33af3abda8dcb4f259ec6bbbc8d40bc997d9e4d4.tar.bz2
dotfiles-33af3abda8dcb4f259ec6bbbc8d40bc997d9e4d4.zip
xinitrc: Source scripts frm xinitrc.d dir
..to be able to initiate a consolekit session, if installed on the systemd.
-rw-r--r--[-rwxr-xr-x].xinitrc22
1 files changed, 18 insertions, 4 deletions
diff --git a/.xinitrc b/.xinitrc
index 4556fcf..97ffbcd 100755..100644
--- a/.xinitrc
+++ b/.xinitrc
@@ -7,8 +7,22 @@ xset r rate 250 50
[[ -x ~/.scripts/disable_touchpad.sh ]] && ~/.scripts/disable_touchpad.sh
-#chooser="/etc/X11/chooser.sh"
-#session=$(XSESSION="${1}" ${chooser})
-#exec ${session:-$(${chooser})}
+unset command
-exec $(XSESSION="${2:-${XSESSION}}" /etc/X11/chooser.sh)
+# temporarily unset XDG_SESSION_COOKIE so consolekit launches a new session
+realxdgcookie="$XDG_SESSION_COOKIE"
+XDG_SESSION_COOKIE=
+# run all system xinitrc shell scripts which will update $command
+if [ -d /etc/X11/xinit/xinitrc.d ]; then
+ for i in /etc/X11/xinit/xinitrc.d/* ; do
+ if [ -x "$i" ]; then
+ . "$i"
+ fi
+ done
+ unset i
+fi
+# restore XDG_SESSION_COOKIE
+XDG_SESSION_COOKIE="$realxdgcookie"
+unset realxdgcookie
+
+exec $command $(XSESSION="${2:-${XSESSION}}" /etc/X11/chooser.sh)