-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackages.sh
executable file
·194 lines (181 loc) · 3.24 KB
/
packages.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
194
# shellcheck shell=bash
# Note: For ttf-nerd-fonts-symbols-mono, use the "Symbols Nerd Font Mono" family
# in your font config.
#
# Symlink /usr/share/fontconfig/conf.avail/10-nerd-font-symbols.conf to
# /etc/fonts/conf.d/, or see `man 5 fonts-conf` for other options.
packages_pacman_base=(
7zip
base-devel
bat
btop
curl
difftastic
dua-cli
duf
entr
eza
fd
ffmpeg
fzf
git
git-delta
git-filter-repo
git-zsh-completion
glow
imagemagick
jq
just
lazygit
lf
libqalculate
lm_sensors
man-db
man-pages
mdcat
mediainfo
miniserve
mtr
neovim
pacman-contrib
parallel
procs
reflector
ripgrep
rsync
skim
starship
tealdeer
thermald
tmux
tree
unarchiver
unzip
vim
wget
yazi
yt-dlp
zip
zoxide
zsh
zstd
)
packages_pacman_desktop=(
bitwarden
brightnessctl
gammastep
github-cli
gnome-keyring
imv
inter-font
kitty
kitty-shell-integration
kitty-terminfo
mpv
nemo
noto-fonts
noto-fonts-emoji
obsidian
papirus-icon-theme
plocate
qalculate-gtk
rofi
seahorse
ttc-iosevka-ss08
ttf-fira-code
ttf-jetbrains-mono
ttf-nerd-fonts-symbols-common
ttf-nerd-fonts-symbols-mono
ttf-opensans
wl-clipboard
)
packages_pacman_server=(
sysstat
)
packages_aur_base=(
lazydocker-bin
topgrade-bin
viddy-bin
)
packages_aur_desktop=(
catppuccin-cursors-macchiato
catppuccin-gtk-theme-macchiato
google-chrome
grimshot-bin-sway
networkmanager-dmenu-git
otf-geist
otf-geist-mono
sublime-text-4
swaync
thorium-browser-bin
ttf-merriweather
visual-studio-code-bin
)
packages_aur_server=()
packages_dnf=(
cargo
exa
golang
nodejs
ranger
rust
tmux
tree
vim-enhanced
zoxide
zsh
)
packages_apt=(
ranger
tmux
tree
zsh
)
detect_distro() {
if [[ -f /etc/os-release ]]; then
. /etc/os-release
DISTRO=${NAME}
elif command -v lsb_release &>/dev/null; then
DISTRO=$(lsb_release -si)
elif [[ -f /etc/lsb-release ]]; then
# shellcheck disable=SC1091
. /etc/lsb-release
# shellcheck disable=SC2154
DISTRO=${DISTRIB_ID}
else
echo "Unable to detect distribution."
exit 1
fi
}
setup_packages() {
if [[ $1 == server ]]; then
local packages_pacman=("${packages_pacman_base[@]}" "${packages_pacman_server[@]}")
local packages_aur=("${packages_aur_base[@]}" "${packages_aur_server[@]}")
else
local packages_pacman=("${packages_pacman_base[@]}" "${packages_pacman_desktop[@]}")
local packages_aur=("${packages_aur_base[@]}" "${packages_aur_desktop[@]}")
fi
if [[ "${DISTRO}" = "Arch Linux" ]]; then
sudo pacman -Syu
sudo pacman -S --needed "${packages_pacman[@]}"
if ! command -v yay &>/dev/null; then
git clone --depth 1 https://aur.archlinux.org/yay-bin.git /tmp/yay &&
cd /tmp/yay &&
makepkg -si &&
command rm -rf /tmp/yay
fi
yay -S --needed "${packages_aur[@]}"
elif [[ "${DISTRO}" = "Fedora Linux" ]]; then
sudo dnf check-update
sudo dnf install -y "${packages_dnf[@]}"
elif [[ "${DISTRO}" = "Ubuntu" ]]; then
command -v nala &>/dev/null && apt=nala || apt=apt
sudo "${apt}" update
sudo "${apt}" install -y "${packages_apt[@]}"
fi
}
main() {
detect_distro
setup_packages "$@"
}
sudo -v && main "$@"