Files
neofig/setup.sh
2025-07-16 18:13:59 +02:00

75 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "🔧 Starting setup on Arch Linux with GNOME..."
# Helper function
install_pkg() {
if ! pacman -Qi "$1" &>/dev/null; then
echo "📦 Installing $1..."
sudo pacman -S --noconfirm "$1"
else
echo "$1 already installed."
fi
}
# 1. Install yay if missing
if ! command -v yay &>/dev/null; then
echo "📦 Installing yay AUR helper..."
sudo pacman -S --needed --noconfirm git base-devel
git clone https://aur.archlinux.org/yay.git /tmp/yay
(cd /tmp/yay && makepkg -si --noconfirm)
fi
# 2. Core dev tools
CORE_PKGS=(
docker
neovim
gcc
clang
nodejs
npm
typescript
jdk-openjdk
base-devel
git
starship
)
for pkg in "${CORE_PKGS[@]}"; do
install_pkg "$pkg"
done
# 3. IntelliJ IDEA Community via yay
if ! command -v idea-community &>/dev/null; then
echo "📦 Installing IntelliJ IDEA (Community)..."
yay -S --noconfirm intellij-idea-community-edition
fi
# 4. Setup Docker group
sudo usermod -aG docker "$USER"
echo "👥 Added user to docker group. Log out and back in to apply."
# 5. Fancy terminal: Starship prompt
if ! grep -q "eval \"\$(starship init bash)\"" ~/.bashrc; then
echo 'eval "$(starship init bash)"' >> ~/.bashrc
fi
# 6. Install Nerd Fonts for icons in terminal
yay -S --noconfirm nerd-fonts
# 7. GNOME Terminal: set fancy profile (colors + font)
PROFILE_ID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
PROFILE_PATH=/org/gnome/terminal/legacy/profiles:/:$PROFILE_ID/
gsettings set org.gnome.Terminal.Legacy.Settings theme-variant 'dark'
gsettings set org.gnome.Terminal.Legacy.Profile:$PROFILE_PATH font 'FiraCode Nerd Font Mono 12'
gsettings set org.gnome.Terminal.Legacy.Profile:$PROFILE_PATH use-system-font false
gsettings set org.gnome.Terminal.Legacy.Profile:$PROFILE_PATH use-theme-colors false
gsettings set org.gnome.Terminal.Legacy.Profile:$PROFILE_PATH background-color '#1E1E1E'
gsettings set org.gnome.Terminal.Legacy.Profile:$PROFILE_PATH foreground-color '#C0C0C0'
echo "🎉 Setup complete! Please restart your terminal or log out and back in."