X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=sidebyside;f=setup.sh;h=2a9185517fe253f51607e5107e1aea057b6c4bf0;hb=f37b00de475a17f19b17da2c1d452bbce3e73cd9;hp=35607c46a59ff5b016ca43909265cc1fe9509f86;hpb=1727213ce076b43f51d004c97e04361c50d05cb5;p=config%2Fdotfiles.git diff --git a/setup.sh b/setup.sh index 35607c4..2a91855 100755 --- a/setup.sh +++ b/setup.sh @@ -1,14 +1,42 @@ +#!/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, UXTerm and Rxvt 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