# Maintainer: Celestia Ludenberg <ash8820@proton.me>

pkgname=antergos-next-desktop-settings
pkgver=1
pkgrel=1
pkgdesc="Antergos NeXT desktop settings, theme, and color scheme"
arch=('any')
url="https://github.com/Antergos-NeXT/antergos-pkgs"
license=('GPL3')
depends=(
  'breeze-icons'
  'breeze-gtk'
  'ttf-opensans'
  'noto-fonts'
)
source=(
  "antergos-next-gtk3.css"
  "antergos-next-gtk4.css"
  "antergos-next-gtkrc"
  "antergos-next-index.theme"
  "AntergosNeXT.colors"
  "gtk-settings.ini"
  "xsettings.xml"
  "antergos-next-dconf"
)
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')

package() {
  # Custom GTK theme
  install -dm755 "${pkgdir}/usr/share/themes/AntergosNeXT/gtk-3.0"
  install -dm755 "${pkgdir}/usr/share/themes/AntergosNeXT/gtk-4.0"
  install -dm755 "${pkgdir}/usr/share/themes/AntergosNeXT/gtk-2.0"
  install -m644 "${srcdir}/antergos-next-gtk3.css" "${pkgdir}/usr/share/themes/AntergosNeXT/gtk-3.0/gtk.css"
  install -m644 "${srcdir}/antergos-next-gtk4.css" "${pkgdir}/usr/share/themes/AntergosNeXT/gtk-4.0/gtk.css"
  install -m644 "${srcdir}/antergos-next-gtkrc" "${pkgdir}/usr/share/themes/AntergosNeXT/gtk-2.0/gtkrc"
  install -m644 "${srcdir}/antergos-next-index.theme" "${pkgdir}/usr/share/themes/AntergosNeXT/index.theme"

  # KDE Color scheme
  install -dm755 "${pkgdir}/usr/share/color-schemes"
  install -m644 "${srcdir}/AntergosNeXT.colors" "${pkgdir}/usr/share/color-schemes/"

  # GTK settings (for all GTK-based DEs)
  install -dm755 "${pkgdir}/etc/skel/.config/gtk-3.0"
  install -m644 "${srcdir}/gtk-settings.ini" "${pkgdir}/etc/skel/.config/gtk-3.0/settings.ini"

  # KDE defaults
  install -dm755 "${pkgdir}/etc/skel/.config"
  cat > "${pkgdir}/etc/skel/.config/kdeglobals" << 'EOF'
[General]
ColorScheme=Antergos NeXT
EOF

  # XFCE defaults
  install -dm755 "${pkgdir}/etc/xdg/xfce4/xfconf/xfce-perchannel-xml"
  install -m644 "${srcdir}/xsettings.xml" "${pkgdir}/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/"

  # dconf overrides (GNOME, Cinnamon, Budgie, Deepin)
  install -dm755 "${pkgdir}/etc/dconf/db/local.d"
  install -m644 "${srcdir}/antergos-next-dconf" "${pkgdir}/etc/dconf/db/local.d/antergos-next"
}
