]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - setup.sh
katarakt.ini: add
[config/dotfiles.git] / setup.sh
1 #!/bin/sh
2
3 # Setup script for X11 configuration files.
4
5 # Copyright (C) 2011-2014  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 set -eu
22
23 . ../lib.sh
24
25
26 if installed stumpwm; then
27     link stumpwmrc ~/.stumpwmrc
28 fi
29 if installed xmonad; then
30     link xmonad ~/.xmonad
31 fi
32 if installed herbstluftwm; then
33     link herbstluftwm ~/.config/herbstluftwm
34 fi
35
36 if installed X; then
37     # Prevent code duplication. Term* rules are for all terminals; XTerm rules
38     # are for XTerm and UXTerm.
39     generate Xresources .in perl -ne \
40         'if (/^Term/) {
41              s/^Term//;
42              print "XTerm", $_;
43              print "UXTerm", $_;
44              print "URxvt", $_;
45          } elsif (/^XTerm/) {
46              print $_;
47              s/^XTerm//;
48              print "UXTerm", $_;
49          } else {
50              print $_;
51          }'
52     # Xresources uses ! as comment instead of #.
53     sed_i 's/^#/!/' Xresources
54     # Use urxvt's pseudo-transparency if neither compton nor xcompmgr are
55     # available. Better than nothing.
56     if ! installed compton && ! installed xcompmgr; then
57         echo 'Xresources: no compton found, enabling pseudo-transparency'
58         sed_i 's/^Rxvt\*background: \[/!&/' Xresources
59         sed_i 's/^!NO_COMPTON //' Xresources
60     fi
61
62     if test ! "x`os`" = xdarwin; then
63         link xinitrc ~/.xinitrc
64         # Most display managers use ~/.xsession instead of ~/.xinitrc (which
65         # is used by e.g. startx). Provide both links.
66         link xinitrc ~/.xsession
67     fi
68     if test -f xinitrc.local; then
69         link xinitrc.local ~/.xinitrc.local
70     fi
71     link xmodmaprc ~/.xmodmaprc
72     link Xresources ~/.Xresources
73     link XCompose ~/.XCompose
74
75     link fonts ~/.fonts
76
77     link bin/xlockscreen ~/.xlockscreen
78 fi
79
80 if installed xpdf; then
81     link xpdfrc ~/.xpdfrc
82 fi
83 if installed zathura; then
84     mkdir -p ~/.config/zathura
85     link zathurarc ~/.config/zathura/zathurarc
86 fi
87 if installed katarakt; then
88     link katarakt.ini ~/.config/katarakt.ini
89 fi
90
91 if installed feh; then
92     mkdir -p ~/.config
93     link feh ~/.config/feh
94     # Older feh versions only support theme options and configure them through
95     # ~/.fehrc.
96     link feh/themes ~/.fehrc
97 fi