dot/xinitrc, dot/xmodmap, setup: Configure keyboard using xmodmap files.
[profile] / dot / xinitrc
index 3141367..9875cad 100755 (executable)
@@ -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.
@@ -92,13 +99,16 @@ 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
 }
 
 ###--------------------------------------------------------------------------
 ### 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)
@@ -330,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
@@ -353,6 +385,7 @@ esac
 case "$wait" in
   yes)
     xwait
+    kill-gnome-session
     ;;
   no)
     info "not waiting before exit"