X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=setup.sh;h=e0c0b5fe33936fb8face1dafb3f6817c57bf55bf;hb=58e666b4d39949f7115eff9e20606a641f93111e;hp=e928a804a3b1036714538c2f06f29d23b76450ce;hpb=2356c71cf1d38a2f09b76d10e6a0ba40dcf9ce11;p=config%2Fdotfiles.git diff --git a/setup.sh b/setup.sh index e928a80..e0c0b5f 100755 --- a/setup.sh +++ b/setup.sh @@ -1,12 +1,41 @@ +#!/bin/sh + # Setup script for X11 configuration files. . ../lib.sh -# Link setup. if installed stumpwm; then link stumpwmrc ~/.stumpwmrc fi +if installed xmonad; then + link . ~/.xmonad +fi + if installed X; then - link xinitrc ~/.xinitrc + # Prevent code duplication. Term* rules are for all terminals; XTerm rules + # are for XTerm and UXTerm. At the moment XTerm and UXTerm are supported. + generate perl Xdefaults -ne \ + 'if (/^Term/) { + s/^Term//; + print "XTerm", $_; + print "UXTerm", $_; + print "Rxvt", $_; + } elsif (/^XTerm/) { + print $_; + s/^XTerm//; + print "UXTerm", $_; + } else { + print $_; + }' + # Xdefaults uses ! as comment instead of #. tmp file necessary because of + # different implementations of `sed -i`. + sed 's/^#/!/' Xdefaults > Xdefaults.tmp + mv Xdefaults.tmp Xdefaults + + if [ `os` != darwin ]; then + link xinitrc ~/.xinitrc + fi + link xmodmaprc ~/.xmodmaprc + link Xdefaults ~/.Xdefaults fi