Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·86 lines (71 loc) · 2.52 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·86 lines (71 loc) · 2.52 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
#!/usr/bin/env bash
set -euo pipefail
# NOTE:
# add ILoveCandy in your /etc/pacman.conf file
# in the Misc options, for a fancier pacman experience
# Update git submodules
echo "🔄 Updating git submodules"
git submodule update --init --recursive --remote
# Set up passwordless sudo for the current user
echo "🔒 Setting up passwordless sudo for user $USER"
if [ -f "/etc/sudoers.d/$USER" ]; then
echo "📦 Passwordless sudo already configured for user $USER"
echo "💡 Skipping sudoers setup"
else
echo "🔄 Configuring passwordless sudo for user $USER"
sudo tee "/etc/sudoers.d/$USER" >/dev/null <<EOF
$USER ALL=(ALL) NOPASSWD: ALL
EOF
fi
# Remove arch-update..
sudo pacman -Rs cachy-update
# Make window switching via alt+tab work
# the way I grew up
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"
echo "📦 Installing default packages from default-packages.txt"
xargs -a ./setup/default-packages.txt paru -S
# Ensure $HOME/.local/bin directory exists
echo "📁 Ensuring ~/.local/bin directory exists"
if [ ! -d ~/.local/bin ]; then
mkdir -p ~/.local/bin
fi
# Install fonts
bash setup/install-fonts.sh
# Make zsh the default shell
echo "🔄 Setting zsh as the default shell"
if [[ "$SHELL" = *zsh ]]; then
echo "📦 zsh already the default shell"
echo "💡 Skipping zsh default shell setup"
else
chsh -s "$(which zsh)"
fi
# Enable auto ssh key unlocking
systemctl enable --user --now gcr-ssh-agent.service
# Configure docker
echo "🐳 Configuring Docker to run without sudo"
if groups "$USER" | grep &>/dev/null '\bdocker\b'; then
echo "📦 User '$USER' is already in the docker group"
echo "💡 Skipping docker group setup"
else
echo "🔄 Adding user '$USER' to the docker group"
if ! getent group docker &>/dev/null; then
echo "🆕 Docker group does not exist. Creating docker group."
sudo groupadd docker
fi
sudo usermod -aG docker "$USER"
fi
# Enable and start docker service
echo "🚀 Enabling and starting Docker service"
if sudo systemctl is-enabled docker.service &>/dev/null; then
echo "📦 Docker service is already enabled"
echo "💡 Skipping docker service enablement"
else
echo "🔄 Enabling Docker service to start on boot"
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
sudo systemctl start docker.service
fi
# Install extras
bash setup/install-extras.sh
echo "✅ Setup completed successfully! Please reboot your system to apply all changes."