]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - setup.sh
feh/themes: Add, default options for feh.
[config/dotfiles.git] / setup.sh
1 #!/bin/sh
2
3 # Setup script for X11 configuration files.
4
5 # Copyright (C) 2011-2012  Simon Ruderich
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20
21 . ../lib.sh
22
23 if installed stumpwm; then
24     link stumpwmrc ~/.stumpwmrc
25 fi
26 if installed xmonad; then
27     link xmonad ~/.xmonad
28 fi
29
30 if installed X; then
31     # Prevent code duplication. Term* rules are for all terminals; XTerm rules
32     # are for XTerm and UXTerm. At the moment XTerm, UXTerm and Rxvt are
33     # supported.
34     generate perl Xdefaults -ne \
35         'if (/^Term/) {
36              s/^Term//;
37              print "XTerm", $_;
38              print "UXTerm", $_;
39              print "Rxvt", $_;
40          } elsif (/^XTerm/) {
41              print $_;
42              s/^XTerm//;
43              print "UXTerm", $_;
44          } else {
45              print $_;
46          }'
47     # Xdefaults uses ! as comment instead of #. tmp file necessary because of
48     # different implementations of `sed -i`.
49     sed 's/^#/!/' Xdefaults > Xdefaults.tmp
50     mv Xdefaults.tmp Xdefaults
51
52     if [ x`os` != xdarwin ]; then
53         link xinitrc ~/.xinitrc
54     fi
55     if [ -f xinitrc.local ]; then
56         link xinitrc.local ~/.xinitrc.local
57     fi
58     link xmodmaprc ~/.xmodmaprc
59     link Xdefaults ~/.Xdefaults
60     link XCompose ~/.XCompose
61 fi
62
63 if installed xpdf; then
64     link xpdfrc ~/.xpdfrc
65 fi
66 if installed zathura; then
67     mkdir -p ~/.config/zathura
68     link zathurarc ~/.config/zathura/zathurarc
69 fi
70
71 if installed feh; then
72     mkdir -p ~/.config
73     link feh ~/.config/feh
74     # Older feh versions only support theme options and configure them through
75     # ~/.fehrc.
76     link feh/themes ~/.fehrc
77 fi