-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup
executable file
·142 lines (136 loc) · 3.39 KB
/
setup
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
#!/bin/sh
cd "$(dirname "$0")" || exit
OP="ln -s"
DIR="$(pwd)"
CONF=${XDG_CONFIG_HOME:-$HOME/.config/}
CONTEXT=${COLORSCHEME:-$(find "$DIR/ntr/contexts" | sort -R | head -1)}
_help() {
echo 'Available targets:
profile
nim
ntr
splug
xinit | sx
Xresources
bspwm
sxhkd
polybar
dunst
rofi
lc
firefox
kitty
elvish
kak (kakoune)
mpv
mpd
ncmpcpp
xonotic
ranger
zathura
neofetch
gtk
user-dirs
fontconfig'
}
_install() {
if [ -e "$2" ]; then
echo "$2 already exists. Skipping..."
else
mkdir -p "$(dirname "$2")"
$OP "$DIR/$1" "$2" && echo "$1 installed to $2"
fi
}
_render() {
ntr -i:"$DIR/ntr/templates/$1" -o:"$2" "$CONTEXT"
}
for arg; do
case $arg in
h|help)
_help;;
-c)
OP="cp -r";;
nim)
_install nim.nim "$CONF/nim/config.nims";;
bspwm)
_install bspwm "$CONF/bspwm/bspwmrc";;
sxhkd)
_install sxhkd "$CONF/sxhkd/sxhkdrc";;
dunst)
_render dunst "$CONF/dunst/dunstrc";;
polybar)
_install polybar.ini "$CONF/polybar/config"
_render polybar "$CONF/polybar/color";;
rofi)
_install rofi.rasi "$CONF/rofi/config.rasi";;
mpv)
_install mpv/mpv.conf "$CONF/mpv/mpv.conf"
_install mpv/input.conf "$CONF/mpv/input.conf"
_install mpv/script-opts "$CONF/mpv/script-opts";;
mpd)
_install mpd "$CONF/mpd/mpd.conf";;
ncmpcpp)
_install ncmpcpp "$CONF/ncmpcpp/config";;
lc)
_install lc.ini "$CONF/lc/config";;
kak)
_install kak/kakrc "$CONF/kak/kakrc"
for i in kak/autoload/* ; do
_install "$i" "$CONF/kak/autoload/$(basename "$i")"
done;;
zathura)
_render zathura "$CONF/zathura/zathurarc";;
ranger)
_install ranger/commands.py "$CONF/ranger/commands.py"
_install ranger/rc.conf "$CONF/ranger/rc.conf"
_install ranger/rifle.conf "$CONF/ranger/rifle.conf"
_install ranger/scope.sh "$CONF/ranger/scope.sh";;
kitty)
_install kitty/kitty.conf "$CONF/kitty/kitty.conf"
_install kitty/diff.conf "$CONF/kitty/diff.conf"
_install kitty/open-actions.conf "$CONF/kitty/open-actions.conf"
_render kitty-colors "$CONF/kitty/colors.conf";;
firefox)
FF_DIR=$HOME/.mozilla/firefox/$(ls -t "$HOME/.mozilla/firefox/" | grep -v profiles.ini | head -1)
_install firefox/user.js "$FF_DIR/user.js"
_install firefox/userChrome.css "$FF_DIR/chrome/userChrome.css"
nim e -p:"$HOME/sns/" firefox/homepage.nims >"$HOME/.mozilla/firefox/homepage.html"
_render homepage.css "$HOME/.mozilla/firefox/homepage.css";;
elvish)
_install elvish/rc.elv "$CONF/elvish/rc.elv"
for i in elvish/lib/* ; do
_install "$i" "$CONF/elvish/lib/$(basename "$i")"
done;;
neofetch)
_install neofetch.sh "$CONF/neofetch/config.conf";;
gitconfig)
_install gitconfig.ini "$CONF/git/config";;
xbps-src)
_install xbps-src "$XBPS_DISTDIR/etc/conf";;
profile)
_install profile "$HOME/.profile";;
Xresources)
_render Xresources "$HOME/.Xresources";;
XCompose)
_install XCompose "$HOME/.XCompose";;
xinit)
_install sx.sh "$HOME/.xinitrc";;
sx)
_install sx.sh "$CONF/sx/sxrc";;
ntr)
_install ntr "$CONF/ntr";;
splug)
_install splug.toml "$CONF/splug/config.toml";;
gtk)
_install gtk/gtkrc "${GTK2_RC_FILES:-$HOME/.gtkrc}"
_install gtk/settings.ini "$CONF/gtk-3.0/settings.ini";;
user-dirs)
_install user-dirs "$CONF/user-dirs.dirs";;
fontconfig)
_install fontconfig "$CONF/fontconfig/fonts.conf";;
xonotic)
_install xonotic.cfg "$HOME/.xonotic/autoexec.cfg";;
*)
echo "Not recognized argument: $arg";;
esac
done