# SPDX-License-Identifier: GPL-3.0-or-later
pkgname=meowven-hyprland
pkgver=0.2.0
pkgrel=1
pkgdesc='Official Meowven Hyprland edition: Chroma shell and the original Meowven rice'
arch=('any')
license=('GPL-3.0-or-later' 'OFL-1.1')
options=('!debug')
depends=('bash' 'coreutils' 'sed' 'python' 'python-pillow' 'hyprland>=0.56'
         'hyprshutdown' 'quickshell' 'awww' 'matugen' 'rofi' 'kitty' 'thunar'
         'hyprshot' 'swappy' 'hypridle' 'hyprlock' 'hyprpolkitagent'
         'xdg-desktop-portal-hyprland' 'xdg-desktop-portal-gtk' 'xdg-utils'
         'dbus' 'systemd' 'procps-ng' 'libnotify' 'brightnessctl'
         'networkmanager' 'wireplumber' 'pipewire-pulse' 'pavucontrol' 'playerctl'
         'wl-clipboard' 'cliphist' 'cava' 'btop' 'starship' 'cbonsai'
         'firefox' 'ttf-jetbrains-mono-nerd' 'ttf-nerd-fonts-symbols-mono'
         'adwaita-icon-theme' 'adw-gtk-theme' 'noto-fonts' 'breeze' 'breeze-icons'
         'meowven-branding>=0.2.0' 'meowven-meow>=0.1.0-2')
optdepends=('flatpak: separately installed Steam or Vesktop applications')
backup=('etc/skel/.config/hypr/hyprland.lua'
        'etc/skel/.config/kitty/kitty.conf'
        'etc/xdg/xdg-desktop-portal/hyprland-portals.conf')
source=('desktop.tar')
sha256sums=('0890b38fe1cd4c3f75f34bef45408d78c8ed9261399505cf7aa2bfdf2f929e71')

package() {
    cd "$srcdir/desktop"
    local config="$pkgdir/etc/skel/.config"
    install -d "$config/chroma"
    cp -a chroma/. "$config/chroma/"
    chmod 755 "$config/chroma/bin/"*
    install -Dm644 hyprland.lua "$config/hypr/hyprland.lua"
    install -Dm644 kitty.conf "$config/kitty/kitty.conf"
    install -Dm755 shell "$pkgdir/usr/lib/meowven-hyprland/shell"
    install -Dm644 hyprland-portals.conf "$pkgdir/etc/xdg/xdg-desktop-portal/hyprland-portals.conf"
    install -Dm644 meowven-hyprland-session.target "$pkgdir/usr/lib/systemd/user/meowven-hyprland-session.target"
    install -Dm755 autostart "$pkgdir/usr/lib/meowven-hyprland/autostart"
    local helper
    for helper in meowven-wallpaper meowven-lock meowven-session-menu meowven-optional-app meowven-screenshot; do
        install -Dm755 "$helper" "$pkgdir/usr/bin/$helper"
    done
    install -d "$pkgdir/usr/share/fonts/meowven"
    install -m644 fonts/*.ttf "$pkgdir/usr/share/fonts/meowven/"
    install -d "$pkgdir/usr/share/licenses/$pkgname"
    install -m644 fonts/*-OFL.txt CREDITS.md "$pkgdir/usr/share/licenses/$pkgname/"
    install -Dm644 KEYS.html "$pkgdir/usr/share/doc/$pkgname/KEYS.html"
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
