Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·78 lines (64 loc) · 2.03 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·78 lines (64 loc) · 2.03 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
#!/bin/bash
set -e
while getopts igmhp flag; do
case "${flag}" in
i) install=true ;; # Install CLI applications
g) gui=true ;; # Install GUI applications
h) hyprland=true ;; # Install hyprland as window manage
p) onepassword=true ;; # Remove 1Password as SSH Agent
esac
done
# Install packages
distro=$(cat /etc/os-release | grep -w ID_LIKE | cut -d= -f2)
if [ "$distro" == "arch" ]; then
# Install cli packages
if [ "$install" ]; then
echo "Installing CLI packages"
sudo pacman-mirrors -c Denmark
sudo pacman -Syyu --noconfirm
sudo pacman -S --needed --noconfirm - <./.extra/req.pacman
yay -S --needed --noconfirm - <./.extra/req.aur
yay -Syyu --noconfirm
fi
# Install gui packages
if [ "$gui" ]; then
echo "Installing GUI packages"
sudo pacman -S --needed --noconfirm - <./.extra/req.pacman.gui
yay -S --needed --noconfirm - <./.extra/req.aur.gui
fi
# Install hyprland
if [ "$hyprland" ]; then
echo "Installing Hyperland and dependencies"
sudo pacman -S --needed --noconfirm - <./.extra/req.pacman.hypr
yay -S --needed --noconfirm - <./.extra/req.aur.hypr
# Setup PAM hook (login + SDDM)"
sudo sed -i \
'/^auth[[:space:]]\+include[[:space:]]\+system-auth/ a auth optional pam_gnome_keyring.so' \
/etc/pam.d/system-login
sudo sed -i \
'/^session[[:space:]]\+include[[:space:]]\+system-auth/ a session optional pam_gnome_keyring.so auto_start' \
/etc/pam.d/system-login
fi
else
echo "Unsupported distro: $distro"
exit 1
fi
# Non distro specific
if [ "$install" ]; then
# Install ZSH
echo "Installing zsh"
./install-zsh.sh
echo "Setting up default ufw"
sudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
echo "Installation Complete!"
fi
# Setup dotfiles
cp -TR ./.home ~/
# Remove 1password agent from services if disabled
if [ "$onepassword" ]; then
sed -i '/^\[gpg "ssh"\]$/,+1d' ~/.gitconfig
sed -i '/^export SSH_AUTH_SOCK/d' ~/.zshrc
fi
echo "Install Script Complete!"