-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
Β·222 lines (191 loc) Β· 6.47 KB
/
install.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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
#!/bin/sh
# Installer Version: 4.3.3
# Based on https://github.com/manas140/dotfiles installer
cr="$(tput setaf 1)"
cg="$(tput setaf 2)"
cb="$(tput setaf 4)"
cw="$(tput sgr0)"
cache_dir="$HOME/.cache"
cache="$cache_dir/Cat-Dots"
home_config="$HOME/.config"
packages="bspwm sxhkd \
polybar rofi zsh alacritty picom-ftlabs-git dunst \
gtk3 gtk4 gtk-engine-murrine gnome-themes-extra \
pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber alsa-utils pamixer \
feh brightnessctl bluez-utils i3lock-color \
yad xclip stalonetray maim gpick imagemagick ffmpeg \
ttf-jetbrains-mono-nerd ttf-jetbrains-mono ttf-sarasa-gothic ttf-roboto \
mpd mpdris2 ncmpcpp playerctl zscroll-git \
polkit-gnome xfce4-power-manager \
libnotify notify-send-py \
xdg-utils xdg-user-dirs xdo xsettingsd \
python3 python-gobject"
clear
make_backups () {
[ ! -d "$HOME/.backups" ] && mkdir "$HOME/.backups" 2>/dev/null
[ ! -d "$HOME/.fonts" ] && mkdir "$HOME/.fonts" 2>/dev/null
[ ! -d "$HOME/.themes" ] && mkdir "$HOME/.themes" 2>/dev/null
[ ! -d "$HOME/.icons" ] && mkdir "$HOME/.icons" 2>/dev/null
tempdir=$(mktemp -d -p "$HOME/.backups")
[ -d "$home_config/bspwm" ] && mv "$home_config/bspwm" "$tempdir"
[ -d "$home_config/cat-configs" ] && mv "$home_config/cat-configs" "$tempdir"
[ -d "$home_config/mpDris2" ] && mv "$home_config/mpDris2" "$tempdir"
[ -f "$home_config/user-dirs.dirs" ] && mv "$home_config/user-dirs.dirs" "$tempdir"
[ -d "$HOME/.mpd" ] && mv "$HOME/.mpd" "$tempdir"
[ -d "$HOME/.ncmpcpp" ] && mv "$HOME/.ncmpcpp" "$tempdir"
}
install_packages () {
echo
printf "%s ____ _ _____ ____ ___ _____ ____\n" "${cr}"
printf "%s / ___| / \|_ _| | _ \ / _ \_ _/ ___|\n" "${cg}"
printf "%s| | / _ \ | |_____| | | | | | || | \___ |\n" "${cr}"
printf "%s| |___ / ___ \| |_____| |_| | |_| || | __) |\n" "${cg}"
printf "%s \____/_/ \_\_| |____/ \___/ |_| |____/\n" "${cr}"
printf "%s The Dotfiles themed with catppuccin colors\n" "${cr}"
echo
echo
printf "%s[*] PROCEDING WILL MAKE A BACKUP FOR ALL YOUR CONFIGS IN ($HOME/.backups)\n" "${cg}" && sleep 1
printf "%s[-] DO YOU WANT TO PROCEED [Y/N] : " "${cr}"
read -r install
case $install in
N|n)
printf "%s[-] Aborting!\n" "${cr}"
exit 0
;;
Y|y)
if command -v pacman; then
printf "%s[*] Updating System\n" "${cg}" && sleep 2
printf "%s" "$cw"
sudo pacman --noconfirm --needed -Syu git wget xorg base-devel
aur_helper
else
printf "%s[-] System is not archlinux\n" "${cr}" && sleep 1
printf "%s[*] Using manual mode\n" "${cb}" && sleep 1
printf "%s[-] The installer will not install the dependencies\n" "${cr}" && sleep 2
copying_files
fi
;;
esac
}
install_aur () {
if command -v "$1"; then
# shellcheck disable=SC2086
printf "%s" "$cw"
$1 -S $packages --needed
else
printf "%s" "$cw"
git clone "$2"
cd "$1-bin" || exit 1
makepkg -si
# shellcheck disable=SC2086
$1 -S $packages --needed
fi
copying_files
}
aur_helper () {
printf "%s[*] Select a AUR helper (Required)\n" "${cr}"
printf "%s[-] (1)paru | (2)yay : " "${cr}"
read -r helper
case $helper in
1)
install_aur paru https://aur.archlinux.org/paru-bin.git
;;
2)
install_aur yay https://aur.archlinux.org/yay-bin.git
;;
esac
}
copying_files () {
printf "%s[*] Getting dotfiles\n" "${cb}" && sleep 2
if [ -d "./cat-configs" ]; then
printf "%s[!] Detected local dotfiles...\n" "${cr}"
cp -rf "./bspwm" "$home_config"
cp -rf "./cat-configs" "$home_config"
cp -rf "./misc/home/." "$HOME"
if command -v pacman; then
cd "./misc/fonts" || exit 1
printf "%s" "$cw"
makepkg -g >> PKGBUILD && makepkg -si
fi
else
cd "$cache_dir" && git clone https://github.com/Deathemonic/Cat-Dots.git
cp -rf "$cache/bspwm" "$home_config"
cp -rf "$cache/cat-configs" "$home_config"
cp -rf "$cache/misc/home/." "$HOME"
if command -v pacman; then
cd "$cache/misc/fonts" || exit 1
printf "%s" "$cw"
makepkg -g >> PKGBUILD && makepkg -si
fi
fi
chmod +x $home_config/cat-configs/bin/system/*
chmod +x $home_config/cat-configs/bin/utilities/*
xdg-user-dirs-update
fc-cache -fv
installing_themes
}
installing_themes () {
printf "%s" "$cw"
cd "$cache_dir" && git clone --recurse-submodules https://github.com/catppuccin/gtk.git cat-gtk
cd cat-gtk || exit 1
python3 -m venv venv
# shellcheck disable=SC1091
. ./venv/bin/activate
pip install -r requirements.txt
python3 install.py all -a all -s standard -d ~/.themes
cd "$cache_dir" && git clone https://github.com/catppuccin/papirus-folders.git cat-folders
cd cat-folders || exit 1
wget -qO- https://git.io/papirus-icon-theme-install | DESTDIR="$HOME/.icons" sh
cp -r ./src/* "$HOME/.icons/Papirus"
cp ./papirus-folders "$HOME/.local/bin"
finishing
}
finishing () {
printf "%s[-] Done\n" "${cb}" && sleep 3
echo
printf "%s[*] Log out at your session for the changes to apply!\n" "${cr}"
echo
printf "%s[|] Any problems with the dotfiles don't be affraid to submit an issue at https://github.com/Deathemonic/Cat-Dots/issues\n" "${cb}"
printf "%s[|] Please go to the Cat-Dot's Github Wiki Page for Manual Installation and fixes\n" "${cb}"
echo
printf "%s[-] Exiting!\n" "${cr}"
}
docs () {
printf %s "${cb}"
echo "
Usage: install [Options]
Options:
backup - just create backups (does not install)
nobackup - install but doesn't create a backup
install - standard install
"
}
setup () {
docs
echo
printf "%s[*] Choose what do you want to do\n" "${cg}"
echo
printf "%s[*] backup, nobackup, or install\n" "${cb}"
echo
printf "%s[*] <Ctrl + C> to exit/cancel\n" "${cb}"
echo
printf "%s[-] Operation : " "${cr}"
read -r choice
case $choice in
backup)
make_backups
;;
nobackup)
install_packages
;;
install)
make_backups
install_packages
;;
*)
clear
setup
;;
esac
}
setup