-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·250 lines (177 loc) · 6.25 KB
/
setup.sh
File metadata and controls
executable file
·250 lines (177 loc) · 6.25 KB
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
#!/bin/bash
ROOT=$(dirname $0)
source $ROOT/setup-scripts/utils.sh
source $ROOT/setup-scripts/nvidia.sh
source $ROOT/setup-scripts/packages.sh
source $ROOT/setup-scripts/shell.sh
source $ROOT/setup-scripts/ssh.sh
source $ROOT/setup-scripts/config.sh
source $ROOT/setup-scripts/backup.sh
cat << "EOF"
__ __ _ _
/ / /\ \ \___| | ___ ___ _ __ ___ ___ | |_ ___
\ \/ \/ / _ \ |/ __/ _ \| '_ ` _ \ / _ \ | __/ _ \
\ /\ / __/ | (_| (_) | | | | | | __/ | || (_) |
\/ \/ \___|_|\___\___/|_| |_| |_|\___| \__\___/
___ _ __ _ _
/\/\ _ _ / \___ | |_ / _(_) | ___ ___
/ \| | | | / /\ / _ \| __| |_| | |/ _ \/ __|
/ /\/\ \ |_| | / /_// (_) | |_| _| | | __/\__ \
\/ \/\__, | /___,' \___/ \__|_| |_|_|\___||___/
|___/
EOF
log "This script will setup the Arch installation."
log "It should be run from the root of the repository."
log "All the replaced files will be placed on '~/.old-dotfiles/'."
echo
if ! ask "Begin the installation?" "N"; then
wait_for_enter "Exiting."
exit 0
fi
cat << "EOF"
___ _____ _ _ _
/ _ \_ __ ___ \_ \_ __ ___| |_ __ _| | |
/ /_)/ '__/ _ \_____ / /\/ '_ \/ __| __/ _` | | |
/ ___/| | | __/_____/\/ /_ | | | \__ \ || (_| | | |
\/ |_| \___| \____/ |_| |_|___/\__\__,_|_|_|
EOF
log "Creating old dotfiles directory..."
setup_old_dotfiles
cat << "EOF"
___ _
/ _ \__ _ ___| | ____ _ __ _ ___ ___
/ /_)/ _` |/ __| |/ / _` |/ _` |/ _ \/ __|
/ ___/ (_| | (__| < (_| | (_| | __/\__ \
\/ \__,_|\___|_|\_\__,_|\__, |\___||___/
|___/
EOF
official_packages=("base-devel" # AUR helper
"linux-lts" "linux-lts-headers" # Kernel
"os-prober" "efibootmgr" "grub" "sbctl" # Bootloader
"xorg" "xorg-xinit" "i3-wm" # Xorg adn i3
"networkmanager" # Network
"firefox" "discord" "nemo" "feh" "vim" "neovim" # Apps
"kitty" "dunst" "picom" "polybar" "rofi" "zsh" "fastfetch" # Terminal and status bar
"pipewire" "pipewire-pulse" "pipewire-alsa" "pipewire-jack" "pavucontrol" # Audio
"sl" "xclip" "playerctl" "flameshot" "bluez" "trash-cli" "man-db" "man-pages"
"udiskie" "arandr" "autorandr" "btop" "powertop" "tlp" "brightnessctl"
"polkit-gnome" "unzip" "rsync" "cronie" # Utilities
"sddm" "qt5-graphicaleffects" "qt5-quickcontrols2" "qt5-svg" # Login manager
"gnome-themes-extra" # Themes
"ttf-jetbrains-mono-nerd" "ttf-droid" # Fonts
)
aur_packages=("visual-studio-code-bin" "cmatrix-git" "i3lock-color" "peaclock"
"adwaita-qt5-git" "adwaita-qt6-git" "checkupdates-with-aur")
log "Configuring pacman..."
sudo_place $ROOT/config/pacman/pacman.conf /etc/pacman.conf
log "Updating the system..."
sudo pacman -Syu --noconfirm
install_official "${official_packages[@]}"
log "Installing yay..."
if install_yay; then
install_aur "${aur_packages[@]}"
else
log "Failed installing yay. Skipping AUR packages..." "Err"
fi
cat << "EOF"
__ _____ ___ _____ _
/\ \ \/\ /\\_ \/ \\_ \/_\
/ \/ /\ \ / / / /\/ /\ / / /\//_\\
/ /\ / \ V /\/ /_/ /_//\/ /_/ _ \
\_\ \/ \_/\____/___,'\____/\_/ \_/
EOF
if ask "Setup NVIDIA drivers?" "Y"; then
setup_nvidia
if ask "Setup Optimus Manager (for deactivating NVIDIA card on laptops)?" "Y"; then
setup_optimus
fi
fi
cat << "EOF"
__ _ _ _
/ _\ |__ ___| | |
\ \| '_ \ / _ \ | |
_\ \ | | | __/ | |
\__/_| |_|\___|_|_|
EOF
log "\nConfiguring zsh with Oh My Zsh and powerlevel10k..."
flavor_shell
log "Configuring vim and neovim"
flavor_vim
if ask "Setup Emacs with Doom? [DEPRECATED - MIGHT NOT WORK]" "N"; then
setup_doom
fi
cat << "EOF"
__ __
/ _\/ _\ /\ /\
\ \ \ \ / /_/ /
_\ \_\ \/ __ /
\__/\__/\/ /_/
EOF
if ask "Setup SSH keys?" "Y"; then
log "Setting passwordless SSH key (stored in $HOME/.ssh/id_ed25519_2)..."
setup_passwordless_ssh
log "Setting SSH key with password..."
prompt "Enter your email" "EMAIL"
setup_passworded_ssh $EMAIL
SSH_KEYS_SETUP=true
else
SSH_KEYS_SETUP=false
fi
cat << "EOF"
___ __ _
/ __\___ _ __ / _(_) __ _
/ / / _ \| '_ \| |_| |/ _` |
/ /__| (_) | | | | _| | (_| |
\____/\___/|_| |_|_| |_|\__, |
|___/
EOF
log "\nConfiguring SDDM..."
config_sddm
log "Configuring fonts..."
config_fonts
log "Setting up scripts..."
place_scripts
log "Configuring power management settings..."
config_power_management
log "Configuring hibernation..."
config_hibernation
log "Configuring touchpad settings..."
config_touchpad
log "Configuring cron..."
config_cron
log "Configuring permissions..."
config_perms
log "Setting up the remaining configuration files..."
config_misc
if $SSH_KEYS_SETUP; then
cat << "EOF"
___ _
/ __\ __ _ ___| | ___ _ _ __ ___
/__\/// _` |/ __| |/ / | | | '_ \/ __|
/ \/ \ (_| | (__| <| |_| | |_) \__ \
\_____/\__,_|\___|_|\_\\__,_| .__/|___/
|_|
EOF
log "Setting up automatic backups requires a server with passwordless SSH." "Warn"
if ask "Setup automatic backups?" "N"; then
prompt "Enter the server destination (remoteuser@remotehost)" "SERVER_HOST"
prompt "Enter the server port" "SERVER_PORT"
prompt "Enter the server destination folder" "SERVER_FOLDER"
config_backups $SERVER_HOST $SERVER_PORT $SERVER_FOLDER
log "Later, you can specify the folders to backup in '~/.config/backup/folders.txt'."
log "To restore the backups, use the 'rbackup' command."
wait_for_enter
fi
fi
cat << "EOF"
___ _ _ _ _
/ __(_)_ __ (_)___| |__ (_)_ __ __ _
/ _\ | | '_ \| / __| '_ \| | '_ \ / _` |
/ / | | | | | \__ \ | | | | | | | (_| |
\/ |_|_| |_|_|___/_| |_|_|_| |_|\__, |
|___/
EOF
echo
if ask "Installation completed. Reboot now?" "Y"; then
sudo reboot
fi