dotfiles/setup
2025-04-25 13:46:37 +02:00

135 lines
3.1 KiB
Bash
Executable File

#!/usr/bin/env bash
DIR="$(dirname $(realpath "$0"))"
cd "$DIR"
if [[ ! -f /etc/os-release ]]; then
echo "Could not determine distribution; exiting..."
exit 1
fi
. /etc/os-release
distro=${NAME,,}
if [[ $distro == "arch linux" ]]; then
pacman=(
# services
"networkmanager"
"bluez" "bluez-libs"
"pipewire" "pipewire-alsa" "pipewire-pulse" "pipewire-audio" "pipewire-jack" "wireplumber"
# Hyprland core
"hyprland" "hypridle" "hyprpaper" "hyprlock"
"hyprpolkitagent" "hyprutils" "hyprland-qtutils"
"xdg-desktop-portal-hyprland" "xdg-desktop-portal-gtk"
# Hyprland extra
"qt6ct" "gnome-keyring"
"waybar" "dunst" "wofi" "wl-clipboard" "copyq" "grim" "slurp"
"adwaita-icon-theme" "adwaita-cursors" "dolphin"
"network-manager-applet" "blueman"
"playerctl" "pavucontrol"
"upower"
# terminal
"kitty" "fish" "ranger" "htop" "tmux" "psmisc"
# misc
"wget" "curl" "git" "entr" "zip" "base-devel"
"ninja" "make" "cmake"
"neofetch" "fortune-mod" "cowsay"
# languages
"python" "php" "go" "clang"
# editors
"nano" "vim" "helix"
# network drives
"rclone" "cifs-utils"
# container
"podman" "podman-compose" "podman-docker" "distrobox"
# VMs
"virtualbox" "virtualbox-host-modules-arch" "linux-headers"
# fonts
"adwaita-fonts"
"ttf-jetbrains-mono" "ttf-jetbrains-mono-nerd"
"noto-fonts" "noto-fonts-emoji" "noto-fonts-cjk"
# flatpak
"flatpak" "libportal"
# apps
"keepassxc" "remmina"
)
yay=(
"light"
"snapd"
"brave-bin"
)
systemd=(
"snapd.socket"
"snapd.apparmor.service"
"NetworkManager.service"
"bluetooth.service"
)
snap_classic=(
"code"
"flutter"
"android-studio"
)
flatpak=(
"org.signal.Signal"
"com.spotify.Client"
"net.ankiweb.Anki"
"org.gimp.GIMP"
"org.inkscape.Inkscape"
"org.onlyoffice.desktopeditors"
"com.github.xournalpp.xournalpp"
"net.nokyan.Resources"
"org.gnome.Loupe"
"org.gnome.Evince"
)
sudo pacman -Syu --noconfirm
sudo pacman --noconfirm --needed -S "${pacman[@]}"
sudo ln -s "$(which helix)" /usr/local/bin/hx
if ! command -v yay &> /dev/null; then
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay && makepkg -si --noconfirm
yay -Sy --noconfirm
cd "$DIR"
fi
yay --noconfirm --needed -S "${yay[@]}"
sudo ln -s /var/lib/snapd/snap /snap
for item in "${systemd[@]}"; do
sudo systemctl enable --now $item
done
while ! sudo snap refresh; do sleep 1; done
sudo snap install "${snap_classic[@]}" --classic
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y "${flatpak[@]}"
else
echo "Unknown distribution '$distro'; exiting..."
exit 1
fi
"$DIR/install"
echo "-"
echo "Done!"