X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/8ab9747e4a9942d928af6ccb9d6ead42ad5b13ea..8ca91005bcad285426003ddbd2c3f1553ab21b90:/dot/xinitrc diff --git a/dot/xinitrc b/dot/xinitrc index 3ae854b..4f69187 100755 --- a/dot/xinitrc +++ b/dot/xinitrc @@ -71,6 +71,13 @@ EOF done ###-------------------------------------------------------------------------- +### Preliminary hook. + +if [ -r $HOME/.xinitrc-prehook ]; then + . $HOME/.xinitrc-prehook +fi + +###-------------------------------------------------------------------------- ### Iniitial settings. ## Assume X sessions are secure. @@ -93,15 +100,12 @@ initialize () { ## Key mappings. xmodmap -e 'keysym BackSpace = BackSpace BackSpace' - - ## Gnome settings. - case $vnc in no) run bginit gnome-settings-daemon ;; esac } ###-------------------------------------------------------------------------- ### Start a window manager. -wm=$(pick_program window-manager enlightenment e16 twm) +wm=$(pick_program window-manager e16 compiz enlightenment e17 twm) wmopts="" case "$wm,$vnc" in enlightenment,yes | e16,yes) @@ -146,41 +150,9 @@ start-window-manager () { start-clients-local () { :; } -scsv=$(pick_program screensaver gnome-screensaver xscreensaver) -case $scsv in - xscreensaver) - scsvopts="-no-splash" - ;; - *) - scsvopts="" - ;; -esac - start-clients () { - ## Mail notification. - run bginit mail-notification - - ## Gnome session. With great reluctance. At least it doesn't actually do - ## anything. - run bginit gnome-session - - ## Policykit authentication agent. - agent=/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 - if [ -x $agent ]; then run bginit $agent; fi - - ## System monitor. - case $vnc in no) run bginit gkrellm ;; esac - - ## Screensaver. - case $vnc in - no) - run init xscreensaver-command -exit - run bginit $scsv $scsvopts - ;; - esac - - ## Panel. - case $vnc in no) run bginit gnome-panel ;; esac + ## Gnome session. + case $vnc in no) run bginit gnome-session ;; esac ## Local clients. start-clients-local @@ -355,6 +327,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 @@ -378,6 +372,7 @@ esac case "$wait" in yes) xwait + kill-gnome-session ;; no) info "not waiting before exit"