-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·193 lines (134 loc) · 5.08 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
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
#!/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/config.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-headers" "linux-lts-headers" # Kernel
"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" # 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")
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?" "Y"; then
setup_doom
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
if ask "Set natural scrolling for touchpad?" "Y"; then
config_touchpad
fi
log "Setting up the remaining configuration files..."
config_misc
cat << "EOF"
___ _ _ _ _
/ __(_)_ __ (_)___| |__ (_)_ __ __ _
/ _\ | | '_ \| / __| '_ \| | '_ \ / _` |
/ / | | | | | \__ \ | | | | | | | (_| |
\/ |_|_| |_|_|___/_| |_|_|_| |_|\__, |
|___/
EOF
echo
if ask "Installation completed. Reboot now?" "Y"; then
sudo reboot
fi