# Maintainer: Nico <d3sox at protonmail dot com>

pkgname=cachyos-nord-kde-theme-git
_themeName=CachyOS-Nord-round
_gitname=cachyos-nord-kde
pkgver=r15.bf78f12
pkgrel=1
groups=(cachyos)
pkgdesc="CachyOS Nord KDE Theme"
arch=('any')
url="https://github.com/CachyOS/CachyOS-Nord-KDE"
license=(GPL-3.0-or-later)
optdepends=('plasma-desktop: for included plasma theme')
depends=(char-white)
makedepends=('git')
source=("cachyos-nord-kde::git+${url}.git#commit=d1fb6a7e88d4caf389c6883242bae7af8a0b14f9")
sha256sums=('2b978620c20565517cccdf52c08a8554fc353854a239762210e39f89dc187619')

pkgver() {
   cd ${_gitname}
   printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
   # make folders
#   mkdir -p "${pkgdir}/usr/share/aurorae/themes"
   mkdir -p "${pkgdir}/usr/share/color-schemes"
   mkdir -p "${pkgdir}/usr/share/plasma/desktoptheme"
   mkdir -p "${pkgdir}/usr/share/plasma/look-and-feel"
#   mkdir -p "${pkgdir}/usr/share/Kvantum"
#   mkdir -p "${pkgdir}/usr/share/sddm/themes"
#   mkdir -p "${pkgdir}/usr/share/wallpapers"

   # aurorae theme
#   cp -r "${srcdir}/${_gitname}/aurorae"/* "${pkgdir}/usr/share/aurorae/themes"
#   # kvantum theme
#   cp -r "${srcdir}/${_gitname}/Kvantum"/* "${pkgdir}/usr/share/Kvantum"
   # color scheme
   cp -r "${srcdir}/${_gitname}/color-schemes"/* "${pkgdir}/usr/share/color-schemes"
   # desktop theme
   cp -r "${srcdir}/${_gitname}/plasma/desktoptheme"/${_themeName}* "${pkgdir}/usr/share/plasma/desktoptheme"
#   cp -r "${srcdir}/${_gitname}/plasma/desktoptheme/icons" "${pkgdir}/usr/share/plasma/desktoptheme/${_themeName}"
#   cp -r "${srcdir}/${_gitname}/plasma/desktoptheme/icons" "${pkgdir}/usr/share/plasma/desktoptheme/${_themeName}-alt"
#   cp -r "${srcdir}/${_gitname}/plasma/desktoptheme/icons" "${pkgdir}/usr/share/plasma/desktoptheme/${_themeName}-dark"
   # look and feel
   cp -r "${srcdir}/${_gitname}/plasma/look-and-feel"/* "${pkgdir}/usr/share/plasma/look-and-feel"
   # wallpaper
 #  cp -r "${srcdir}/${_gitname}/wallpapers"/*  "${pkgdir}/usr/share/wallpapers"
#   # sddm
#   cp -r "${srcdir}/${_gitname}/sddm/${_themeName}" "${pkgdir}/usr/share/sddm/themes"

   # latte
#   mkdir -p "$HOME/.config/latte"
#   cp -r "${srcdir}/${_gitname}/latte-dock"/* "$HOME/.config/latte"
#   printf "%b" "\e[1;33m==> WARNING: \e[0mThe package installed a latte-dock theme which is not deleted on removal. (Located in $HOME/.config/latte)\n"

}
