-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
install
executable file
Β·536 lines (428 loc) Β· 15.1 KB
/
install
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
#!/bin/sh
# v5.8.0
# Why this looks bloated for a simple install script?
# Because this has a lot of cases and if statements because it constantly checking if the file exist or the program exist and etc.
config_dir="$HOME/.config"
cache_dir="$HOME/.cache"
tempdir=$(mktemp -d -p $HOME/.backups)
packages="polybar-git rofi rofi-emoji rofi-greenclip alacritty picom-arian8j2-git dunst-git eww-x11 ffmpeg \
pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber alsa-utils pamixer \
bluez bluez-utils \
mpd mpdris2-git \
brightnessctl playerctl light lm_sensors wmctrl \
feh i3lock-color sddm yad xclip maim slop gpick xfce4-power-manager zscroll-git neovim viewnior stalonetray redshift \
ttf-sarasa-gothic ttf-jetbrains-mono ttf-roboto nerd-fonts-jetbrains-mono \
gtk3 gtk-engine-murrine gnome-themes-extra papirus-icon-theme \
xdg-user-dirs xdg-utils"
alert () {
log_info="$(date +"%H:%M:%S") \e[0;34mINFO\e[0m"
log_error="$(date +"%H:%M:%S") \e[1;31mERROR\e[0m"
log_warning="$(date +"%H:%M:%S") \e[0;33mWARNING\e[0m"
log_success="$(date +"%H:%M:%S") \e[0;32mSUCCESS\e[0m"
case $1 in
-e)
printf "$log_error %s\n" "$2"
;;
-w)
printf "$log_warning %s\n" "$2"
;;
-s)
printf "$log_success %s\n" "$2"
;;
*)
printf "$log_info %s\n" "$1"
;;
esac
}
first_choice () {
clear
echo
alert -w "If you are not on archlinux it will just install the dotfile you might have to install the dependencies manually"
alert "Read the repo's wiki for more information."
echo
read -p "Are you on Arch Linux? Y/N : " arch
case $arch in
Y|y|Yes|yes)
confirm_install
updating_packages
;;
*)
confirm_install
noarch_wm
installing_dotfiles
;;
esac
}
confirm_install () {
clear
echo
echo "
βββββββββββ βββββββββββββββββββββββββββββββββββ βββββββ βββββββββββββββββ
βββββββββββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββ ββ βββββββββ ββββββ βββ βββ ββββββ βββ βββ ββββββββ
ββββββββββββββββββββββββ ββββββ βββ βββ ββββββ βββ βββ ββββββββ
ββββββββββββββββββββββββββββββββββ βββ βββββββββββββββββ βββ ββββββββ
ββββββββ ββββββββ ββββββββββββββββ βββ βββββββ βββββββ βββ ββββββββ
"
echo
echo
read -p "Are you sure you want to continue? Y/N : " confirm
case $confirm in
Y|y|Yes|yes)
make_cache
cloning_dotfiles
;;
*)
alert -e "Aborting!"
exit 0
;;
esac
}
make_cache () {
echo
alert "Making Cache Folders"
sleep 2
[[ ! -d $HOME/.cache ]] && mkdir -p $HOME/.cache
[[ ! -d $HOME/.backups ]] && mkdir -p $HOME/.backups
[[ ! -d /usr/share/xsessions ]] && sudo mkdir -p /usr/share/xsessions/
echo
alert -s "Caching Done!"
echo
}
cloning_dotfiles () {
alert "Cloning repository"
sleep 2
[[ ! -d $cache_dir/SweetDots ]] && cd $cache_dir && git clone https://github.com/Deathemonic/SweetDots -b xorg || cd $cache_dir/SweetDots && git pull
echo
alert -s "Cloning Done!"
echo
}
make_backup () {
alert "Making Backups"
sleep 2
echo
alert -w "Backup Folder is in ~/.backups"
[[ -d $config_dir/bspwm ]] && mv $config_dir/bspwm $tempdir
[[ -d $config_dir/berry ]] && mv $config_dir/berry $tempdir
[[ -d $config_dir/i3 ]] && mv $config_dir/i3 $tempdir
[[ -d $config_dir/leftwm ]] && mv $config_dir/leftwm $tempdir
[[ -d $config_dir/mpDris2 ]] && mv $config_dir/mpDris2 $tempdir
echo
alert -s "Backup Done!"
echo
sleep 5
}
updating_packages () {
alert "Updating Packages"
sleep 2
sudo pacman -Syu --needed xorg xorg-apps base-devel git curl bash zsh python moreutils perl cmake
echo
alert -s "Update Done!"
echo
installing_aur
}
installing_aur () {
alert "Installing AUR"
sleep 2
echo
if ! command -v yay && ! command -v paru; then
alert -e "Can't find a AUR Helper, Installing"
echo
alert "Pick a AUR Helper"
echo
read -p "(1) paru | (2) yay : " helper
case $helper in
1)
cd $cache_dir
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin
makepkg -si
paru -S --needed $packages
echo
alert -s "AUR Done!"
echo
updating_fonts
;;
2)
cd $cache_dir
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
yay -S --needed $packages
echo
alert -s "AUR Done!"
echo
updating_fonts
;;
*)
alert -e "Invalid Choice. Aborting!"
exit 0
;;
esac
else
if command -v yay; then
yay -S --needed $packages
echo
alert -s "AUR Done!"
echo
updating_fonts
elif command -v paru; then
paru -S --needed $packages
echo
alert -s "AUR Done!"
echo
updating_fonts
else
alert -e "AUR Helper has not installed yet please run the script again or install Yay or Paru"
exit 0
fi
fi
}
updating_fonts () {
alert "Updating Fonts"
sleep 2
cd $cache_dir/SweetDots/misc/fonts/material-design-icons
makepkg -g >> PKGBUILD && makepkg -si
fc-cache -fv
echo
alert -s "Update Done!"
echo
pick_wm
}
pick_wm () {
echo
alert "Pick a Window Manager"
sleep 2
echo
echo "BSPWM (1)"
echo "BerryWM (2)"
echo "i3-Gaps (3)"
echo "LeftWM (4)"
echo "All (5)"
echo
echo "More Window Manager will be added soon"
echo
read -p "Window Manager : " wm
case $wm in
1)
config_str="bspc config border_radius 20"
[[ -d $config_dir/mpDris2 ]] && mv $config_dir/mpDris2 $tempdir
[[ -d $config_dir/bspwm ]] && mv $config_dir/bspwm $tempdir
cp -rf $cache_dir/SweetDots/window-managers/bspwm $config_dir
echo
alert "Choose which type of bspwm you want"
echo
echo
echo "bspwm-git (1) - The official build but without integrated border radius"
echo "bspwm-rounded-corners-git (2) - Adds integrated border radius without depending on picom"
echo
read -p "BSPWM: " bspwm
case $bspwm in
1)
bspwm="bspwm-git"
sed -i '/$config_str/d' $config_dir/bspwm/bspwmrc
;;
2)
bspwm="bspwm-rounded-corners-git"
if ! grep -Fxq "$config_str" $config_dir/bspwm/bspwmrc; then
echo $config_str >> $config_dir/bspwm/bspwmrc
fi
;;
*)
alert -e "Invalid Choice. Aborting!"
exit 0
;;
esac
if command -v paru; then
paru -S $bspwm sxhkd
echo
alert -s "Installing Done!"
echo
installing_dotfiles
elif command -v yay; then
yay -S $bspwm_type sxhkd
echo
alert -s "Installing Done!"
echo
installing_dotfiles
else
alert -e "AUR Helper has not installed yet please run the script again or install Yay or Paru"
fi
;;
2)
[[ -d $config_dir/mpDris2 ]] && mv $config_dir/mpDris2 $tempdir
[[ -d $config_dir/berry ]] && mv $config_dir/berry $tempdir
[[ ! -f /usr/share/xsessions/berry.desktop ]] && cp $cache_dir/misc/xsessions/berry.desktop /usr/share/xsessions/
cp -rf $cache_dir/SweetDots/window-managers/berry $config_dir
if command -v paru; then
paru -S berry-git sxhkd
echo
alert -s "Installing Done!"
echo
installing_dotfiles
elif command -v yay; then
yay -S berry-git sxhkd
echo
alert -s "Installing Done!"
echo
installing_dotfiles
else
alert -e "AUR Helper has not installed yet please run the script again or install Yay or Paru"
fi
;;
3)
[[ -d $config_dir/mpDris2 ]] && mv $config_dir/mpDris2 $tempdir
[[ -d $config_dir/i3 ]] && mv $config_dir/i3 $tempdir
cp -rf $cache_dir/SweetDots/window-managers/i3 $config_dir
if command -v paru; then
paru -S i3-gaps-next-git
echo
alert -s "Installing Done!"
echo
installing_dotfiles
elif command -v yay; then
yay -S i3-gaps-next-git
echo
alert -s "Installing Done!"
echo
installing_dotfiles
else
alert -e "AUR Helper has not installed yet please run the script again or install Yay or Paru"
fi
;;
4)
[[ -d $config_dir/mpDris2 ]] && mv $config_dir/mpDris2 $tempdir
[[ -d $config_dir/leftwm ]] && mv $config_dir/leftwm $tempdir
cp -rf $cache_dir/SweetDots/window-managers/leftwm $config_dir
if command -v paru; then
paru -S leftwm-git
echo
alert -s "Installing Done!"
echo
installing_dotfiles
elif command -v yay; then
yay -S leftwm-git
echo
alert -s "Installing Done!"
echo
installing_dotfiles
else
alert -e "AUR Helper has not installed yet please run the script again or install Yay or Paru"
fi
;;
5)
noarch_wm
config_str="bspc config border_radius 20"
[[ ! -f /usr/share/xsessions/berry.desktop ]] && cp $cache_dir/misc/xsessions/berry.desktop /usr/share/xsessions/
echo
alert "Choose which type of bspwm you want"
echo
echo
echo "bspwm-git (1) - The official build but without integrated border radius"
echo "bspwm-rounded-corners-git (2) - Adds integrated border radius without depending on picom"
echo
read -p "BSPWM: " bspwm
case $bspwm in
1)
bspwm="bspwm-git"
sed -i '/$config_str/d' $config_dir/bspwm/bspwmrc
;;
2)
bspwm="bspwm-rounded-corners-git"
! grep -Fxq "$config_str" $config_dir/bspwm/bspwmrc && echo $config_str >> $config_dir/bspwm/bspwmrc
;;
*)
alert -e "Invalid Choice. Aborting!"
exit 0
;;
esac
if command -v paru; then
paru -S $bspwm berry-git i3-gaps-next-git leftwm-git sxhkd
echo
alert -s "Installing Done!"
echo
installing_dotfiles
elif command -v yay; then
yay -S $bspwm berry-git i3-gaps-next-git leftwm-git sxhkd
echo
alert -s "Installing Done!"
echo
installing_dotfiles
else
alert -e "AUR Helper has not installed yet please run the script again or install Yay or Paru"
fi
;;
*)
alert -e "Invalid Choice. Aborting!"
exit 0
;;
esac
}
noarch_wm () {
make_backup
alert "Copying Window Managers"
sleep 2
[[ ! -f /usr/share/xsessions/berry.desktop ]] && cp $cache_dir/misc/xsessions/berry.desktop /usr/share/xsessions/
cp -rf $cache_dir/SweetDots/window-managers/* $config_dir
echo
alert -s "Copying Done!"
echo
}
installing_dotfiles () {
alert "Copying Dotfiles"
if [[ ! -d $config_dir/sweetconfigs-xorg ]]; then
cp -rf $cache_dir/SweetDots/sweetconfigs-xorg $config_dir
else
alert -e "SweetDots are already installed"
read -p "Do you want to install it anyway Y/N : " existed
case $existed in
Y|y|Yes|yes)
[[ -d $config_dir/sweetconfigs-xorg ]] && mv $config_dir/sweetconfigs-xorg $tempdir
cp -rf $cache_dir/SweetDots/sweetconfigs-xorg $config_dir
;;
esac
fi
[[ ! -d $config_dir/mpDris2 ]] && cp -rf $cache_dir/SweetDots/misc/mpDris2 $config_dir
echo
alert -s "Copying Done!"
sleep 2
echo
executable
}
executable () {
alert "Setting scripts to be executables"
sleep 2
chmod +x $config_dir/sweetconfigs-xorg/bin/bar/*
chmod +x $config_dir/sweetconfigs-xorg/bin/menu/*
chmod +x $config_dir/sweetconfigs-xorg/bin/system/*
chmod +x $config_dir/sweetconfigs-xorg/bin/utilities/*
chmod +x $config_dir/sweetconfigs-xorg/bin/widgets/*
chmod +x $config_dir/sweetconfigs-xorg/eww/scripts/*
[[ -f $config_dir/bspwm/bspwmrc ]] && chmod +x $config_dir/bspwm/bspwmrc
[[ -f $config_dir/berry/autostart ]] && chmod +x $config_dir/berry/autostart
echo
alert -s "Setting Done!"
sleep 2
echo
environments
}
environments () {
alert "Setting environments"
sleep 2
cp -f $cache_dir/SweetDots/misc/env/user-dirs.dirs $config_dir
cp -f $cache_dir/SweetDots/misc/env/.zshenv $HOME
xdg-user-dirs-update
echo
alert -s "Environments Done!"
sleep 2
echo
finishing
}
finishing () {
alert "If you have problems with the installer please create a issue from the repo."
alert "If you have something to improve please create a pull request from the repo."
sleep 2
echo
alert -s "Done!"
}
first_choice