-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchlinux.sh
More file actions
executable file
·137 lines (119 loc) · 2.86 KB
/
archlinux.sh
File metadata and controls
executable file
·137 lines (119 loc) · 2.86 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
#!/usr/bin/env bash
set -eu
source ./_common.sh
OS_ALIAS="archlinux"
TIMEZONE=Europe/Berlin
IS_MIRROR_UPDATED=""
update_mirrors() {
[[ -n "$IS_MIRROR_UPDATED" ]] && return 0
echo_gray "updating mirror list..."
sudo reflector \
--country Germany,Netherlands,France \
--age 6 \
--protocol https \
--sort rate \
--fastest 18 \
--exclude 'moson.org' \
--exclude 'ovh.net' \
--save /etc/pacman.d/mirrorlist || return 1
sudo sed -i '1i Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' /etc/pacman.d/mirrorlist || return 1
IS_MIRROR_UPDATED="true"
}
init_pacman_keyring() {
echo_gray "initializing pacman keyring..."
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman -Sy --needed --noconfirm archlinux-keyring
}
update_pacman() {
update_mirrors
echo_gray "updating pacman packages..."
sudo pacman -Syu --noconfirm
sudo rm -rf /var/cache/pacman/pkg/download-*
sudo pacman -Sc --noconfirm
}
install_yay() (
[[ ! -d "$DEST_CONFIG_DIR/yay" ]] && cp_config "yay"
command -v yay &>/dev/null && {
echo_gray "yay already installed"
exit 0
}
echo_amber "installing yay..."
dir=$(mktemp -d)
trap 'rm -rf "$dir"' EXIT
git clone https://aur.archlinux.org/yay.git "$dir"
cd "$dir" || exit 1
makepkg -si --noconfirm
yay -Y --gendb --noconfirm
)
update_yay() {
update_mirrors
echo_gray "updating yay packages..."
yay -Syu --noconfirm
yay -Yc --noconfirm
}
yay_install_pkg() {
update_mirrors
local items=()
read_package_file_to_array "$OS_ALIAS" items
[[ ${#items[@]} == 0 ]] && return
echo_gray "found ${#items[@]} yay packages to install"
yay -S --needed --noconfirm "${items[@]}"
}
bootstrap() {
setup_timezone
init_pacman_keyring
update_pacman
install_yay
update_yay
yay_install_pkg
install_or_update_rust
install_or_update_aws_cli_linux
install_or_update_aws_sam_cli_linux
install_gtk_theme
}
post_config_os() {
post_config_linux
link_home "bash/$OS_ALIAS.sh" ".bashrc"
link_home "zsh/$OS_ALIAS.sh" ".zshrc"
link_home "zsh/$OS_ALIAS-profile.sh" ".zprofile"
link_config "wallpaper"
link_config "code-flags.conf"
link_config "dunst"
link_config "hypr"
link_config "rofi"
link_config "waybar"
link_config "gtk-3.0"
cp_config "gtk-4.0"
link_config "qt5ct"
link_config "qt6ct"
setup_libvirt
enable_service "acpid"
enable_service "bluetooth"
enable_service "fstrim.timer"
enable_service "NetworkManager"
enable_service "power-profiles-daemon"
}
do_update() {
update_yay
install_or_update_rust
install_or_update_aws_cli_linux
install_or_update_aws_sam_cli_linux
}
main() {
if should_config; then
pre_config_generic
post_config_os
return
elif should_update; then
do_update
return
elif should_full; then
pre_config_generic
bootstrap
post_config_os
return
fi
}
set_run_mode "$@"
main