#!/bin/bash # purpose: Setup script for flouda's Hyprland desktop # author: flouda set -euxo pipefail # source the base script source <(curl -fsSL https://scripts.flouda.net/base) function install_packages() { local packages=( hyprland hyprpaper hyprlock hyprcursor xdg-desktop-portal-hyprland xdg-desktop-portal-gtk polkit wofi waybar greetd greetd-regreet kitty uwsm papirus-icon-theme swaync xorg-xhost polkit-gnome nemo nemo-fileroller brightnessctl playerctl pipewire pipewire-pulse pipewire-alsa wireplumber nwg-look otf-font-awesome ttf-font-awesome ttf-nerd-fonts-symbols ttf-fira-code ttf-input ttf-liberation ttf-ubuntu-font-family ttf-dejavu noto-fonts noto-fonts-emoji nerd-fonts pavucontrol wl-clipboard eog grim slurp hyprpicker jq gnome-text-editor npm nodejs tesseract tesseract-data-eng wlogout bettergruvbox-gtk-theme papirus-folders bibata-cursor-theme-bin grimblast-git zen-browser-bin bemoji wtype zsh fzf ranger tmux zoxide obsidian tree-sitter-cli imagemagick lazygit network-manager-applet gparted neovim-symlinks accountsservice ncdu htop zsh-autosuggestions zsh-syntax-highlighting fd mpv tldr nmap tree ufw libnotify ) ensure_packages "${packages[@]}" } function setup_oh_my_zsh() { # install oh-my-zsh if [[ ! -d "${HOME}/.oh-my-zsh" ]]; then warning "Installing Oh My Zsh..." sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended else info "Oh My Zsh is already installed." fi # set zsh as the default shell if [[ "$SHELL" != "/bin/zsh" ]]; then warning "Setting Zsh as the default shell..." sudo chsh -s /bin/zsh ${USER} else info "Zsh is already the default shell." fi # install zsh plugins if [[ ! -d "${HOME}/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]]; then warning "Installing zsh-autosuggestions plugin..." git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions fi if [[ ! -d "${HOME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]]; then warning "Installing zsh-syntax-highlighting plugin..." git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting fi } function place_dotfiles() { # dotfiles: https://git.flouda.net/arch/dotfiles.git git clone --bare --depth=1 https://git.flouda.net/arch/dotfiles.git $HOME/.dotfiles /usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" checkout /usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" config --local status.showUntrackedFiles no # greetd config: https://git.flouda.net/arch/greetd-conf.git if [ -d /tmp/greetd-conf ]; then rm -rf /tmp/greetd-conf fi git clone --depth=1 https://git.flouda.net/arch/greetd-conf.git /tmp/greetd-conf sudo cp /tmp/greetd-conf/* /etc/greetd/ } function foss_setup() { # foss: First-time login, One-shot, Self-destroying Setup warning "Setting up FOSS (First-time login, One-shot, Self-destroying Setup)..." wget https://git.flouda.net/arch/foss/raw/branch/main/foss-setup.sh -O ${HOME}/.config/foss-setup.sh wget https://git.flouda.net/arch/foss/raw/branch/main/foss.service -O ${HOME}/.config/systemd/user/foss.service chmod +x ~/.config/foss-setup.sh # enable the foss service touch ${HOME}/first-run systemctl --user daemon-reexec systemctl --user daemon-reload systemctl --user enable foss.service } check_arch_based_system check_user_privileges set_nopasswd trap 'remove_nopasswd' EXIT ensure_yay install_packages # setup_oh_my_zsh if [[ "$SHELL" != "/bin/zsh" ]]; then warning "Setting Zsh as the default shell..." sudo chsh -s /bin/zsh ${USER} else info "Zsh is already the default shell." fi place_dotfiles sudo systemctl enable accounts-daemon.service sudo systemctl enable greetd.service foss_setup reboot_prompt wait