#!/usr/bin/env bash # usage: sudo ./debian.sh [--sway] [--homedir] set -e username="$(logname)" user_home="/home/$username" check_sudo() { if [ "$EUID" -ne 0 ]; then echo "This script must be run with sudo." exit 1 fi } packages_base() { echo "Installing base dev packages..." apt update && apt upgrade -y apt install -y \ aptitude \ flatpak \ bash-completion jq rsync sshfs \ git curl ninja-build gettext cmake build-essential \ gnupg pass stow tmux \ python3-full \ btop ranger fastfetch \ zip unzip \ zsh zsh-autosuggestions zsh-syntax-highlighting \ curl -fsSL https://tailscale.com/install.sh | sh \ sudo -u "$username" curl -LsSf https://astral.sh/uv/install.sh | sh } packages_sway() { echo "Installing sway + desktop extras..." apt install -y \ brightnessctl cliphist wl-clipboard \ foot sway swaybg swayidle swaylock wmenu \ gimp grim slurp mako-notifier libnotify-bin \ mpd mpc mpv ncmpcpp \ wayland-protocols wayland-utils \ xdg-desktop-portal-wlr xwayland xwaylandvideobridge \ fonts-3270 fonts-jetbrains-mono fonts-font-awesome fonts-unifont fonts-noto-color-emoji \ pipewire \ extrepo \ extrepo enable librewolf \ apt install librewolf -y } # only for fresh installs! zdotdir() { echo "export ZDOTDIR='$HOME/.config/zsh'" >> /etc/zsh/zshenv } install_sway=false for arg in "$@"; do case "$arg" in --sway) install_sway=true ;; *) echo "Unknown option: $arg"; exit 1 ;; esac done check_sudo packages_base zdotdir if [ "$install_sway" = true ]; then packages_sway fi echo echo "Setup complete! Reboot or log out/in."