#!/bin/bash
set -euo pipefail

echo "::group:: ===$(basename "$0")==="

# Базовые утилиты и инструменты
BASIC_PACKAGES=(
  htop
  fastfetch
  nvtop
  notify-send
  zsh
  zsh-completions
  starship
  bash-completion
  inxi
  openssh-server
  iucode_tool
  systemd-ssh-agent
  ptyxis
  gparted
  obs-studio
  mpd
  ncmpcpp
  icon-theme-Papirus
  python3-modules-sqlite3
  aplay
  mdadm
  ffmpeg
  yt-dlp
  pip
  ollama
  NetworkManager-applet-gtk
  NetworkManager-openvpn
  nekoray
  grim
)

GAMING_PACKAGES=(
  i586-steam
  i586-xorg-drv-radeon
  i586-xorg-dri-radeon
  i586-xorg-dri-swrast
  i586-libGL
  i586-libEGL
  i586-libxatracker
  i586-libgbm
  i586-libGLES
  i586-libGLX
  i586-libglvnd
  i586-libnsl1
  portproton
  i586-libvulkan1
  i586-libd3d
  i586-libgio
  i586-libnm
  i586-libnss
  i586-glibc-nss
  i586-glibc-pthread
  i586-libunwind
)

# Генератор ZRAM
ZRAM_PACKAGES=(
  zram-generator
)

# SWAY — базовые сеансы
SWAY_SESSION_PACKAGES=(
  sway
  waybar
  kitty
  thunar
  rofi
  dunst
  ly
  xdg-desktop-portal
  xdg-user-dirs
  brightnessctl
  autotiling
  pavucontrol
  blueman
  gnome-disk-utility
  swaylock
  nwg-look
  NetworkManager-tui
)


# GNOME — темы, шрифты и оформление
GNOME_THEMES=(
  gtk3-theme-adw-gtk3
  gnome-icon-theme
  gnome-icon-theme-symbolic
  gnome-themes-extra
  libgtk2-engine-adwaita
  fonts-otf-abattis-cantarell
  fonts-ttf-cjkuni-ukai
  fonts-ttf-liberation
  fonts-ttf-dejavu
)


# Прочие приложения
MISC_APPS=(
  virt-manager
  firefox
  papers
  power-profiles-daemon
)

# Xorg-драйверы для различных GPU и устройств
DRIVERS=(
  xorg-drv-libinput
  xorg-drv-qxl
  xorg-drv-spiceqxl
  xorg-drv-intel
  xorg-drv-amdgpu
  xorg-drv-vmware
  xorg-drv-nouveau
  xorg-dri-swrast
)

# Wayland/Qt/Vulkan утилиты
WAYLAND_QT=(
  qt5-wayland
  qt6-wayland
  wayland-utils
  vulkan-tools
)

# Аудиоподсистема (PipeWire)
AUDIO_PACKAGES=(
  pipewire
  wireplumber
)

# Сеть и печать (Avahi, CUPS, fwupd, etc.)
NETWORK_PRINT_PACKAGES=(
  avahi-daemon
  cups-browsed
  fwupd
  libnss-mdns
  wsdd
)

apt-get install -y \
  "${BASIC_PACKAGES[@]}" \
  "${ZRAM_PACKAGES[@]}" \
  "${SWAY_SESSION_PACKAGES[@]}" \
  "${GNOME_THEMES[@]}" \
  "${MISC_APPS[@]}" \
  "${DRIVERS[@]}" \
  "${WAYLAND_QT[@]}" \
  "${AUDIO_PACKAGES[@]}" \
  "${GAMING_PACKAGES[@]}" \
  "${NETWORK_PRINT_PACKAGES[@]}"

echo "::endgroup::"
