/
setup-arch.sh
executable file
·98 lines (84 loc) · 1.74 KB
/
setup-arch.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
#!/usr/bin/env bash
function cargo_check() {
if ! command -v paru >/dev/null 2>&1; then
if ! command -v cargo >/dev/null 2>&1; then
if [ -d ~/.cargo/bin ]; then
export PATH="$HOME/.cargo/bin:$PATH"
fi
cargo install paru
fi
fi
}
# Check if $DISPLAY is set
active_monitors=$(xrandr | grep -c " connected")
if [ -n "$active_monitors" ]; then
# Configure polybar: {{{
sudo pacman --noconfirm -S polybar
# }}}
fi
# NVIM configuration: {{{
if [ ! -d /root/.config ]; then
sudo mkdir -p /root/.config
fi
if [ ! -d /root/.config/nvim ]; then
sudo cp -afr ~/.config/nvim/ /root/.config/nvim
fi
nvim --headless +PackerSync +qa
# }}}
#: {{{ AUR packages
arch_aur_packages="
bibata-cursor-theme-bin
docker-desktop
dunst-git
feh-git
flameshot-git
google-chrome-dev
gruvbox-material-gtk-theme-git
gruvbox-material-icon-theme-git
gruvbox-plus-icon-theme-git
i3-git
i3lock-git
i3status-git
kitty-git
kitty-shell-integration-git
kitty-terminfo-git
libinput-gestures-git
libxfce4util-devel
nbfc-linux
nerd-fonts-inter
pavucontrol-git
pcmanfm-git
polybar-git
rofi-bluetooth-git
rofi-git
rofi-greenclip
simplescreenrecorder-bin
slack-desktop
wlr-protocols-git
xf86-input-libinput-git
xfce4-dev-tools-devel
xfce4-power-manager-git
xinit-xsession
xsecurelock-git
"
# Install AUR packages
cargo_check
IFS=' ' read -r -a packages <<< "$arch_aur_packages"
for package in "${packages[@]}"; do
if ! paru -Qi "$package" >/dev/null 2>&1; then
paru -S --noconfirm "$package"
else
echo "$package is already installed"
fi
done
# }}}
# Configure zsh: {{{
sudo chsh "$(whoami)" -s "$(which zsh)"
sudo chsh -s "$(which zsh)"
if [ ! -d /root/.config/zsh ]; then
sudo cp -afr ~/.config/zsh/ /root/.config/zsh
fi
# shellcheck disable=SC1090
source ~/.zshrc
# }}}
exec $(which zsh)