chiark / gitweb /
setup: Preprocess the Xdefaults file before installing it.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 23 Jul 2015 08:50:10 +0000 (09:50 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 23 Jul 2015 08:50:10 +0000 (09:50 +0100)
Now applications can read the resources even if they haven't been
attached to the root window.

setup

diff --git a/setup b/setup
index 2d5a0d080092ca3095b931c18440efbe5bef5879..2b2ead2ba5e20d8c81e44373f3b0aa70c5455578 100755 (executable)
--- a/setup
+++ b/setup
@@ -153,7 +153,7 @@ dotfiles="
   w3m-config:.w3m/config elinks.conf:.elinks/elinks.conf
   dircolors colordiffrc screenrc cvsrc indent.pro"
 [ "$xstuff" ] && dotfiles="$dotfiles
-  xinitrc xsession xmodmap Xdefaults vncrc vncsession
+  xinitrc xsession xmodmap vncrc vncsession
   fonts.conf
   stalonetrayrc
   putty-defaults:.putty/sessions/Default%20Settings
@@ -177,6 +177,25 @@ for d in $dotfiles; do
 done
 echo " all done."
 
+## CPP-hack files which need it.
+cppfiles=""
+[ "$xstuff" ] && cppfiles="$cppfiles
+  Xdefaults"
+echo "Hacking files with C preprocessor..."
+for c in $cppfiles; do
+  target=.$c
+  case $c in
+    *:*) target=${c#*:} c=${c%%:*};;
+  esac
+  ft=$HOME$sub/$target
+  dir=${ft%/*}
+  mkdir -p $dir
+  cpp dot/$c -o $ft.new
+  mv $ft.new $ft
+  echo "  $target"
+done
+echo " all done."
+
 ## Substitute things which need substituting.
 dotfilessubst="
   gitconfig