From 33af3abda8dcb4f259ec6bbbc8d40bc997d9e4d4 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 12 Oct 2011 22:29:41 +0200 Subject: xinitrc: Source scripts frm xinitrc.d dir ..to be able to initiate a consolekit session, if installed on the systemd. --- .xinitrc | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) mode change 100755 => 100644 .xinitrc (limited to '.xinitrc') diff --git a/.xinitrc b/.xinitrc old mode 100755 new mode 100644 index 4556fcf..97ffbcd --- 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) -- cgit