-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·120 lines (94 loc) · 3.66 KB
/
setup.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
# Directory the script is located in
scriptDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
errorCodes=0
# If .bashrc file exists, delete it. Then stow the custom one
if [[ -f ~/.bashrc ]] && ! [[ -L ~/.bashrc ]]; then
echo ".bashrc file already exists. Removing..."
rm -f ~/.bashrc
fi
stow --no-folding -v -d "$scriptDir" bash
errorCodes+=$?
# If bspwmrc file exists, delete it. Then stow the custom one
if [[ -f ~/.config/bspwm/bspwmrc ]] && ! [[ -L ~/.config/bspwm/bspwmrc ]]; then
echo "BSPWM config already exists. Removing..."
rm -rf ~/.config/bspwm
fi
stow --no-folding -v -d "$scriptDir" bspwm
errorCodes+=$?
# If sxhkdrc file exists, delete it and stow the custom one
if [[ -f ~/.config/sxhkd/sxhkdrc ]] && ! [[ -L ~/.config/sxhkd/sxhkdrc ]]; then
echo "SXHKD config already exists. Removing..."
rm -rf ~/.config/sxhkd
fi
stow --no-folding -v -d "$scriptDir" sxhkd
errorCodes+=$?
# Check if termite file exists, delete it and stow the custom one
if [[ -f ~/.config/termite/config ]] && ! [[ -L ~/.config/termite/config ]]; then
echo "Termite config already exists. Removing..."
rm -rf ~/.config/termite
fi
stow --no-folding -v -d "$scriptDir" termite
errorCodes+=$?
# If polybar config file exists, delete it and stow the custom one
if [[ -f ~/.config/polybar/config ]] && ! [[ -L ~/.config/polybar/config ]]; then
echo "Polybar config already exists. Removing..."
rm -rf ~/.config/polybar
fi
stow --no-folding -v -d "$scriptDir" polybar
errorCodes+=$?
# If rofi config file exists, delete it and stow the custom one
if [[ -f ~/.config/rofi/config ]] && ! [[ -L ~/.config/rofi/config ]]; then
echo "Rofi config already exists. Removing..."
rm -rf ~/.config/rofi
fi
stow --no-folding -v -d "$scriptDir" rofi
errorCodes+=$?
# If imwheel config file exists, delete it and stow the custom one
if [[ -f ~/.imwheelrc ]] && ! [[ -L ~/.imwheelrc ]]; then
echo "IMWheel config already exists. Removing..."
rm -rf ~/.imwheelrc
fi
stow --no-folding -v -d "$scriptDir" imwheel
errorCodes+=$?
# If picom config file exists, delete it and stow the custom one
if [[ -f ~/.config/picom/picom.conf ]] && ! [[ -L ~/.config/picom/picom.conf ]]; then
echo "picom config already exists. Removing..."
rm -rf ~/.config/picom/picom.conf
fi
stow --no-folding -v -d "$scriptDir" picom
errorCodes+=$?
# If kitty config file exists, delete it and stow the custom one
if [[ -f ~/.config/kitty/kitty.conf ]] && ! [[ -L ~/.config/kitty/kitty.conf ]]; then
echo "kitty config already exists. Removing..."
rm -rf ~/.config/kitty/kitty.conf
fi
stow --no-folding -v -d "$scriptDir" kitty
errorCodes+=$?
# If paru config file exists, delete it and stow the custom one
if [[ -f ~/.config/paru/paru.conf ]] && ! [[ -L ~/.config/paru/paru.conf ]]; then
echo "paru config already exists. Removing..."
rm -rf ~/.config/paru/paru.conf
fi
stow --no-folding -v -d "$scriptDir" paru
errorCodes+=$?
# If wallpaper file exists, delete it and stow the custom one
if [[ -f ~/Pictures/alps4K.png ]] && ! [[ -L ~/Pictures/alps4K.png ]]; then
echo "wallpaper already exists. Removing..."
rm -rf ~/Pictures/alps4K.png
fi
stow --no-folding -v -d "$scriptDir" wallpaper
errorCodes+=$?
# If chrome config file exists, delete it and stow the custom one
if [[ -f ~/.config/chrome-flags.conf ]] && ! [[ -L ~/.config/chrome-flags.conf ]]; then
echo "chrome config already exists. Removing..."
rm -rf ~/.config/chrome-flags.conf
fi
stow --no-folding -v -d "$scriptDir" chrome
errorCodes+=$?
# Check for errors
if [[ "$errorCodes" -eq 0 ]]; then
echo "Everything was executed correctly."
else
echo "Something went wrong, please check."
fi