-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.sh
99 lines (87 loc) · 1.83 KB
/
config.sh
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
#!/bin/bash
function array2str() {
local arrayname="$1"
local isfirst=1
for i in $(eval "echo \${!$arrayname[@]}") ; do
[ $isfirst = 1 ] && isfirst=0 || echo -n '\|'
eval "echo -n \${$arrayname[$i]}"
done
}
is_cip() {
case "$HOSTNAME" in
faui0*)
return 0
;;
*)
return 1
;;
esac
}
# create the following directories in home
createdirectories=(
.config
.themes
.mplayer
.gnupg
.ncmpcpp
.local/share/qutebrowser
)
homedir=(
bash.d
bashrc
zshrc
zprofile
calcrc
dialogrc
gitconfig
tigrc
#emacs
#emacs.d
pinforc
ghci
screenrc
latexmkrc
tmux.conf
vimrc
vitrc
inputrc
gvimrc
spacemacs
$(is_cip && echo taskrc.cip || echo taskrc)
Xdefaults{,.d}
abcde.conf
)
files=(
config/*[^~]
config/qutebrowser/userscripts
config/qutebrowser/greasemonkey/
finch-gntrc
${homedir[@]}
ncmpcpp-config
mplayer.conf
gpg.conf
pandoc
openbox-themes/*/
)
relpath2target=(
# just a list of sed commands
"s#taskrc\.cip#$HOME/.taskrc#"
"s#^\($(array2str homedir)\)\$#$HOME/.\1#"
"s#^ncmpcpp-config#$HOME/.ncmpcpp/config#"
"s#^gpg.conf#$HOME/.gnupg/gpg.conf#"
"s#^finch-gntrc#$HOME/.gntrc#"
"s#^mplayer.conf#$HOME/.mplayer/config#"
"s,^config/qutebrowser/userscripts,$HOME/.local/share/qutebrowser/userscripts,"
"s,^config/qutebrowser/greasemonkey,$HOME/.local/share/qutebrowser/greasemonkey,"
"s#^config/\(.*\)\$#$HOME/.config/\1#"
"s,^pandoc$,$HOME/.local/share/pandoc,"
"s#^openbox-themes/\(.*\)\$#$HOME/.themes/\1#"
)
# options
origfile_width="-20"
# colors
color_skip="\e[0;1;41m"
color_source="\e[0m\e[1;36m"
color_target="\e[0m\e[0;34m"
color_default="\e[0m"
color_link="\e[0m\e[0;32m"