diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-09-21 08:59:48 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-09-21 08:59:48 +0200 |
commit | 4c6606a58fd3eff872ebf5bc5cc4adad029f233c (patch) | |
tree | 61e609ddd7e733ffba65bfdc20bf459f381067ec /.xinitrc | |
parent | 8a74f1fe5ba4b13e552c0423df3bf5d0180a0a55 (diff) | |
download | dotfiles-4c6606a58fd3eff872ebf5bc5cc4adad029f233c.tar.gz dotfiles-4c6606a58fd3eff872ebf5bc5cc4adad029f233c.tar.bz2 dotfiles-4c6606a58fd3eff872ebf5bc5cc4adad029f233c.zip |
xinitrc: Use dbus session from $XDG_RUNTIME_DIR if available
That means systemd --user started dbus.socket :)
Diffstat (limited to '.xinitrc')
-rw-r--r-- | .xinitrc | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -11,17 +11,22 @@ unset command -# 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 - [[ -x "$i" ]] && . "$i" - done +if [ -S $XDG_RUNTIME_DIR/dbus/user_bus_socket ] +then + export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/dbus/user_bus_socket +else + # 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 + [[ -x "$i" ]] && . "$i" + done + fi + # restore XDG_SESSION_COOKIE + XDG_SESSION_COOKIE="$realxdgcookie" + unset realxdgcookie fi -# restore XDG_SESSION_COOKIE -XDG_SESSION_COOKIE="$realxdgcookie" -unset realxdgcookie exec $command $(XSESSION="${2:-${XSESSION}}" /etc/X11/chooser.sh) |