blob: d43483f076ebe8977ed822e9eed6185522e483b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
#!/usr/bin/env bash
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
function print_help {
echo "Install configuration options to the correct paths."
echo ""
echo " USAGE:"
echo " install.sh [OPTIONS] [PROG [PROG ...]]"
echo ""
echo " OPTIONS:"
echo " -f, --force Force and overwrite current"
echo " configurations."
echo " -h, --help Print this help message."
echo " PROG The program for which the config should"
echo " be installed. If this is left empty it will"
echo " install all the configurations. More that"
echo " one can be specified."
echo ""
echo " EXAMPLE:"
echo " install.sh -f emacs X tmux i3"
}
function ln_configs {
ln $EXTRA_OPTS ${SCRIPT_DIR}/${1} $2
}
function mk {
if [[ $FORCE -eq 1 ]]; then
mkdir -p "$1"
fi
}
EXTRA_OPTS=" -s "
for i in "$@"; do
case $i in
-f | --force)
EXTRA_OPTS+=" -f "
FORCE=1
;;
-h | --help)
print_help
exit 0
;;
emacs) EMACS=1; NOT_ALL=1;;
X) X=1; NOT_ALL=1;;
tmux) TMUX=1; NOT_ALL=1;;
i3) I3=1; NOT_ALL=1;;
zsh) ZSH=1; NOT_ALL=1;;
isync) ISYNC=1; NOT_ALL=1;;
polybar) POLYBAR=1; NOT_ALL=1;;
compton) COMPTON=1; NOT_ALL=1;;
firefox) FIREFOX=1; NOT_ALL=1;;
ncmpcpp) NCMPCPP=1; NOT_ALL=1;;
mpd) MPD=1; NOT_ALL=1;;
bspwm) BSPWM=1; NOT_ALL=1;;
rofi) ROFI=1; NOT_ALL=1;;
rofi) TERMITE=1; NOT_ALL=1;;
*)
print_help
exit 1
esac
done
if [[ ! -z $EMACS ]] || [[ -z $NOT_ALL ]]; then
echo "Installing emacs config..."
mk ~/.emacs.d
cp ${SCRIPT_DIR}/emacs/init.el ~/.emacs.d/init.el
ln_configs emacs/loader.org ~/.emacs.d/loader.org
fi
if [[ ! -z $X ]] || [[ -z $NOT_ALL ]]; then
echo "Installing X config..."
ln_configs X/.Xmodmap ~/.Xmodmap
ln_configs X/.Xresources ~/.Xresources
ln_configs X/.xinitrc ~/.xinitrc
fi
if [[ ! -z $TMUX ]] || [[ -z $NOT_ALL ]]; then
echo "Installing tmux config..."
ln_configs tmux/.tmux.conf ~/.tmux.conf
fi
if [[ ! -z $I3 ]] || [[ -z $NOT_ALL ]]; then
echo "Installing i3 config..."
mk ~/.config/i3
ln_configs i3/config ~/.config/i3/config
fi
if [[ ! -z $ZSH ]] || [[ -z $NOT_ALL ]]; then
echo "Installing zsh config..."
ln_configs zsh/.zshrc ~/.zshrc
ln_configs zsh/.zsh ~/.zsh
fi
if [[ ! -z $ISYNC ]] || [[ -z $NOT_ALL ]]; then
echo "Installing isync config..."
ln_configs isync/.mbsyncrc ~/.mbsyncrc
fi
if [[ ! -z $POLYBAR ]] || [[ -z $NOT_ALL ]]; then
echo "Installing polybar config..."
mk ~/.config/polybar
ln_configs polybar/config ~/.config/polybar/config
ln_configs polybar/launch.sh ~/.config/polybar/launch.sh
fi
if [[ ! -z $COMPTON ]] || [[ -z $NOT_ALL ]]; then
echo "Installing compton config..."
mk ~/.config
ln_configs compton/compton.conf ~/.config/compton.conf
fi
if [[ ! -z $FIREFOX ]] || [[ -z $NOT_ALL ]]; then
echo "Installing firefox config..."
#ln_configs firefox/userChrome.css ~/.mozilla/firefox/1ye8etqv.default/chrome/userChrome.css
fi
if [[ ! -z $NCMPCPP ]] || [[ -z $NOT_ALL ]]; then
echo "Installing ncmpcpp config..."
mk ~/.ncmpcpp
ln_configs ncmpcpp/bindings ~/.ncmpcpp/bindings
ln_configs ncmpcpp/config ~/.ncmpcpp/config
fi
if [[ ! -z $MPD ]] || [[ -z $NOT_ALL ]]; then
echo "Installing mpd config..."
mk ~/.config/mpd
ln_configs mpd/mpd.conf ~/.config/mpd/mpd.conf
fi
if [[ ! -z $BSPWM ]] || [[ -z $NOT_ALL ]]; then
echo "Installing bspwm config..."
mk ~/.config/bspwm
ln_configs bspwm/bspwmrc ~/.config/bspwm/bspwmrc
mk ~/.config/sxhkd
ln_configs sxhkd/sxhkdrc ~/.config/sxhkd/sxhkdrc
fi
if [[ ! -z $ROFI ]] || [[ -z $NOT_ALL ]]; then
echo "Installing rofi config..."
mk ~/.config/rofi
ln_configs rofi/config ~/.config/rofi/config
fi
if [[ ! -z $TERMITE ]] || [[ -z $NOT_ALL ]]; then
echo "Installing termite config..."
mk ~/.config/termite
ln_configs termite/config ~/.config/termite/config
fi
|