Gnome hacking: Introduce a custom session file.
[profile] / setup
diff --git a/setup b/setup
index 42c0cd7..3df6067 100755 (executable)
--- a/setup
+++ b/setup
@@ -129,13 +129,16 @@ fi
 ## Symlink the various dotfiles into place
 dotfiles="
   bash_profile bash_logout bashrc inputrc bash_completion
-  emacs emacs-calc vm gnus.el
+  emacs emacs-calc vm gnus.el ercrc.el
   vimrc mg zile
+  ditz-config
   mailrc signature
   cgrc tigrc
   gdbinit
   guile
+  rcrc
   toprc
+  mc-ini:.mc/ini mc-panels.ini:.mc/panels.ini
   aspell.conf
   lisp-init.lisp:.cmucl-init.lisp
     lisp-init.lisp:.sbclrc
@@ -148,6 +151,7 @@ dotfiles="
   fonts.conf
   stalonetrayrc
   putty-defaults:.putty/sessions/Default%20Settings
+  mdw.session:.config/gnome-session/sessions/mdw.session
   eterm-theme.cfg:.Eterm/themes/Eterm/theme.cfg
   e-keybindings.cfg:.enlightenment/keybindings.cfg
   evnc-keybindings.cfg:.enlightenment-vnc/keybindings.cfg
@@ -167,6 +171,32 @@ for d in $dotfiles; do
 done
 echo " all done."
 
+## Substitute things which need substituting.
+dotfilessubst="
+  gitconfig
+  pulse-default.pa.in:.pulse/default.pa"
+echo "Installing dotfiles with substitutions..."
+for d in $dotfilessubst; do
+  case $d in
+    *:*) target=${d#*:} d=${d%%:*};;
+    *) target=.$d d=$d.in;;
+  esac
+  ft=$HOME$sub/$target
+  dir=${ft%/*}
+  mkdir -p $dir
+  sed "
+1i\
+### generated by $here/setup; do not edit!\
+
+/@home@/ s\a\a$HOME\ag
+/@releasekey@/ s\a\a$(bin/mdw-conf release-key 481334C2)\ag
+/@gitignore@/ s\a\a$(bin/mdw-conf gitignore $here/git/gitignore)\ag
+" dot/$d >$ft.new
+  mv $ft.new $ft
+  echo "  $target"
+done
+echo "  all done."
+
 ## Symlink backgrounds.
 backgrounds="
   jue-peek.jpg
@@ -192,20 +222,6 @@ if [ "$xstuff" ]; then
 fi
 
 ###--------------------------------------------------------------------------
-### Process the Git configuration.
-
-echo -n "Installing Git configuration:"
-sed "
-1i\
-### generated by $here/setup; do not edit!\
-
-/@releasekey@/ s::$(bin/mdw-conf release-key 481334C2):g
-/@gitignore@/ s::$(bin/mdw-conf gitignore $here/git/gitignore):g
-" git/gitconfig >$HOME/.gitconfig.new
-mv $HOME/.gitconfig.new $HOME/.gitconfig
-echo " done."
-
-###--------------------------------------------------------------------------
 ### Install useful scripts included in this package.
 
 scripts="
@@ -215,6 +231,7 @@ scripts="
   mdw-build
   emacsclient-hack
   movemail-hack
+  aspell-hack
   emerge-hack
   lesspipe.sh
   start-ssh-agent
@@ -235,12 +252,25 @@ for s in $scripts; do
 done
 echo " all done."
 
+hacks="
+  ssh:ssh"
+echo "Installing hacks..."
+for h in $hacks; do
+  d=${h%%:*} h=${h#*:}
+  ft=$HOME$sub/bin/hacks/$d
+  mkdir -p $ft
+  ln -s $here/hacks/$h $ft/$h.new
+  mv $ft/$h.new $ft/$h
+  echo "  $d:$h"
+done
+echo " all done."
+
 ###--------------------------------------------------------------------------
 ### Set up the Emacs config.
 
 $echon "Finding a suitable emacs:$echoc"
 emacs=no
-for i in emacs22 emacs21 emacs; do
+for i in emacs22 emacs23 emacs21 emacs; do
   if type -p >/dev/null $i; then
     emacs=$i
     break