X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/6f6bd6daee43fc16b124a9591b76bd60bc91d6d1..596c5c5fd32e20997b49312af1aae8fd588a0f69:/dot/xinitrc diff --git a/dot/xinitrc b/dot/xinitrc index 9c158bb..210a76d 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,22 @@ start-window-manager () { start-clients-local () { :; } start-clients () { + ## Gnome session. - case $vnc in no) run bginit gnome-session ;; esac + case "$vnc,$(xfce4-session --version 2>&1),$(gnome-session --version 2>&1)" + in + no,xfce4-session*) + run bginit xfce4-session + ;; + 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,*,gnome-session*) + run bginit gnome-session + ;; + esac ## Local clients. start-clients-local @@ -327,6 +344,38 @@ 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 +} + +dbus-service-running-p () { + dbus-send >/dev/null 2>&1 --session --print-reply \ + --dest=org.freedesktop.DBus / \ + org.freedesktop.DBus.GetNameOwner string:$1 +} + +kill-gnome-session () { + win=nil + while read service object logout; do + if dbus-service-running-p $service; then win=t; break; fi + done <