-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
152 lines (131 loc) · 7.06 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
#!/bin/bash
# ██╗███╗ ██╗███████╗████████╗ █████╗ ██╗ ██╗ ███████╗██╗ ██╗
# ██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██║ ██║ ██╔════╝██║ ██║
# ██║██╔██╗ ██║███████╗ ██║ ███████║██║ ██║ ███████╗███████║
# ██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║ ██║ ╚════██║██╔══██║
# ██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗██╗███████║██║ ██║
# ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝╚══════╝╚═╝ ╚═╝
# from github.com/thecaprisun/dots
# add me on discord, _the.sun_
# email me at s̵̯̟͍̘̲͉͍̹̯̺̫͉̰̟͌͂̏̆̏ȗ̸̮̆̎͆͝ǹ̶̡̲͖̤͚̜̺̣̣̙͖̘̣̱̗͠@̵͔̩̮̖̺̊́́̉̇͗̕͝b̷̢̻͇͍͖͎̺̜̗͎̼̺̉̂̔̇͋̅̇̀̔ͅĺ̴̘͉̜̭̬͖̽̾̀͂̆͛̐͒̃̚ệ̵̡̡̣͖̦̮̈́̇͗͗̐͛̀̿̉̓̈́̿̕͝ë̷̢̮̙͚͈͈̓̽͛̂̽͛͝d̷͖͉̟̤̦͕̋͗̎͌i̸̟̳̦̬͓͍̪̻͓̾̑͊͛̀̊̈̔̊̂͜͝n̸̡̯̳͇͖̮̼̼̜̎̿̎̾̋̀̃̅͑͑̈͠ģ̵͖̹͓̳̪͎͕̙̅̔̉̈́̎̈́̈́̃͒͊͠b̸̧̪̻̹͖̞͖͋̂͒ǫ̵͕͓̫̻͙̳͎̓̍̇̀̊̃̌̕̚͝x̵̩̣̥͈̥̤̝͌́̋́͊̃͒̎̋̃̉.̸̢̭̺́͑̋̀͛̔́̇̉͠͝d̴͙̱̞̞͍̃̇̒̀̕ë̸̢̨̨͖͚̦̺͙̤̫̹̣̰̘́̀̅̐̾͐͒̏́́̋̂̐v̶̢̧̰̻͉̣̜̲̬͚̳͊́͑̇̍
clear
echo "██╗███╗ ██╗███████╗████████╗ █████╗ ██╗ ██╗ ███████╗██╗ ██╗"
echo "██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██║ ██║ ██╔════╝██║ ██║"
echo "██║██╔██╗ ██║███████╗ ██║ ███████║██║ ██║ ███████╗███████║"
echo "██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║ ██║ ╚════██║██╔══██║"
echo "██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗██╗███████║██║ ██║"
echo "╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝╚══════╝╚═╝ ╚═╝"
echo "╔══════════════════════════════════════════════════════════════════════════════════╗"
echo "║This will install my dotfiles onto your system. ║"
echo "║Your current configurations (if you have any) will be backed up to ~/.old-configs.║"
echo "╚══════════════════════════════════════════════════════════════════════════════════╝"
echo "Do you want to continue? (y/n)"
read input < /dev/tty
if [ "$input" != "y" ]; then
echo "Aborting."
exit 1
fi
packages="i3 polybar alacritty rofi vim picom nitrogen polkit-gnome pulseaudio"
install_packages() {
local pkg_manager=$1
local install_command=$2
echo "Installing packages using $pkg_manager..."
sudo $install_command $packages
}
echo "Detecting package manager..."
if command -v apt-get >/dev/null; then
pkg_manager="apt-get"
install_command="apt-get install -y"
echo "Detected apt-get"
elif command -v yum >/dev/null; then
pkg_manager="yum"
install_command="yum install -y"
echo "Detected yum"
elif command -v dnf >/dev/null; then
pkg_manager="dnf"
install_command="dnf install -y"
echo "Detected dnf"
elif command -v pacman >/dev/null; then
pkg_manager="pacman"
install_command="pacman -S --noconfirm"
echo "Detected pacman"
elif command -v zypper >/dev/null; then
pkg_manager="zypper"
install_command="zypper install -y"
echo "Detected zypper"
elif command -v emerge >/dev/null; then
pkg_manager="emerge"
install_command="emerge"
echo "Detected emerge"
elif command -v xbps-install >/dev/null; then
pkg_manager="xbps-install"
install_command="xbps-install -Sy"
echo "Detected xbps-install"
elif command -v apk >/dev/null; then
pkg_manager="apk"
install_command="apk add"
echo "Detected apk"
else
echo "Error: No supported package manager found, you'll have to install the dependencies by hand."
pkg_manager=""
fi
if [ -n "$pkg_manager" ]; then
echo "Updating the system..."
case $pkg_manager in
apt-get)
sudo apt-get update
;;
dnf | yum)
sudo $pkg_manager makecache
;;
zypper)
sudo zypper refresh
;;
xbps-install)
sudo xbps-install -Syu
;;
apk)
sudo apk update
;;
esac
install_packages $pkg_manager "$install_command"
echo "Installation of packages completed."
else
echo "Skipping package installation due to unsupported package manager."
fi
echo "Backing up current configurations to ~/.old-configs..."
backup_dir=~/.old-configs
mkdir -p $backup_dir
configs=("i3" "alacritty" "polybar" "rofi" "picom.conf" "vimrc")
for config in "${configs[@]}"; do
if [ -e ~/.config/$config ] || [ -e ~/$config ]; then
cp -r ~/.config/$config $backup_dir 2>/dev/null || cp ~/$config $backup_dir
fi
done
echo "Removing old configurations..."
for config in "${configs[@]}"; do
rm -rf ~/.config/$config 2>/dev/null || rm -f ~/$config
done
echo "Cloning the dotfiles repo..."
git clone https://github.com/thecaprisun/dots
echo "Moving the new dotfiles..."
cd dots
cp -r config/* ~/.config/
cp .vimrc ~/
echo "Installing JetBrainsMono Nerd Font..."
curl -L -o JetBrainsMono.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/JetBrainsMono.zip
unzip -d ~/.local/share/fonts JetBrainsMono.zip
echo "Done!"
# ****** ******
# ********** **********
# ************* *************
# *****************************
# *****************************
# *****************************
# ***************************
# ***********************
# *******************
# ***************
# ***********
# *******
# ***