#!/bin/bash

# Installing Hyprland core components
echo -e "${GREEN}Installing Hyprland core components...${DEFAULT}"
check_installation "sudo pacman -S --noconfirm --needed" "wayland hyprland waybar hyprpaper xdg-desktop-portal-hyprland xdg-desktop-portal-gtk polkit-gnome"

# Installing audio components
echo -e "${GREEN}Installing audio components...${DEFAULT}"
check_installation "sudo pacman -S --noconfirm --needed" "pipewire pipewire-pulse wireplumber pamixer pavucontrol"

# Installing system utilities
echo -e "${GREEN}Installing system utilities...${DEFAULT}"
check_installation "sudo pacman -S --noconfirm --needed" "brightnessctl networkmanager network-manager-applet blueman inetutils"

# Installing GUI applications
echo -e "${GREEN}Installing GUI applications...${DEFAULT}"
check_installation "sudo pacman -S --noconfirm --needed" "rofi thunar thunar-archive-plugin mpv imv"

# Installing theme tools
echo -e "${GREEN}Installing Qt/GTK configuration tools...${DEFAULT}"
check_installation "sudo pacman -S --noconfirm --needed" "qt5-wayland qt6-wayland qt5ct qt6ct kvantum kvantum-qt5"

# Installing AUR packages
echo -e "${GREEN}Installing AUR packages...${DEFAULT}"
check_installation "yay -S --noconfirm --needed" "ttf-jetbrains-mono-nerd swaylock-effects wlogout gruvbox-material-gtk-theme-git gruvbox-material-icon-theme-git bibata-cursor-theme"

# Installing Firefox
echo -e "${GREEN}Installing Firefox...${DEFAULT}"
check_installation "sudo pacman -S --noconfirm" "firefox"

# Configuring Firefox
mkdir -p $HOME/.config/betterfox/
git update-index --assume-unchanged ~/.local/share/chezmoi/private_dot_config/betterfox/user.js

echo -e "${GREEN}Desktop environment installation completed${DEFAULT}"
