X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/6f6bd6daee43fc16b124a9591b76bd60bc91d6d1..faa3255614fbe4a3e5780cc482640cafba59da43:/dot/xinitrc diff --git a/dot/xinitrc b/dot/xinitrc index 9c158bb..9875cad 100755 --- a/dot/xinitrc +++ b/dot/xinitrc @@ -99,7 +99,10 @@ initialize () { run init xset m 2 1 ## Key mappings. - xmodmap -e 'keysym BackSpace = BackSpace BackSpace' + xmodmap $HOME/.xmodmap + if [ -r $HOME/.xmodmap-local ]; then + xmodmap $HOME/.xmodmap-local + fi } ###-------------------------------------------------------------------------- @@ -151,8 +154,18 @@ start-window-manager () { start-clients-local () { :; } start-clients () { + ## Gnome session. - case $vnc in no) run bginit gnome-session ;; esac + case "$vnc,$(gnome-session --version 2>&1)" in + no,gnome-session\ 2.3[2-9].* | \ + no,gnome-session\ 2.4[0-9].* | \ + no,gnome-session\ 2.[1-9][0-9][0-9]*) + run bginit gnome-session --session mdw + ;; + no,*) + run bginit gnome-session + ;; + esac ## Local clients. start-clients-local @@ -327,6 +340,28 @@ EOF } ###-------------------------------------------------------------------------- +### Gnome session care and feeding. + +session-running-p () { + dbus-send --session --print-reply --dest=org.freedesktop.DBus / \ + org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager \ + >/dev/null 2>&1 +} + +kill-gnome-session () { + if session-running-p; then + info "killing Gnome session manager" + dbus-send --session \ + --dest=org.gnome.SessionManager /org/gnome/SessionManager \ + org.gnome.SessionManager.Logout uint32:2 + for i in 1 2 3 4 5; do + sleep 1 + if ! session-running-p; then break; fi + done + fi +} + +###-------------------------------------------------------------------------- ### Actually start things up. if [ -f $HOME/.xinitrc-local ]; then @@ -350,6 +385,7 @@ esac case "$wait" in yes) xwait + kill-gnome-session ;; no) info "not waiting before exit"