Last active
June 23, 2025 12:00
-
-
Save kRHYME7/5e016e94f6eaaa0ddf99090b47a02458 to your computer and use it in GitHub Desktop.
Hyprland-plugins-git | A revised git version of the AUR PKGBUILD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: x70b1 | |
# Contributor: khing | |
pkgname=('hyprland-plugin-borders-plus-plus-git' 'hyprland-plugin-csgo-vulkan-fix-git' 'hyprland-plugin-hyprbars-git' 'hyprland-plugin-hyprexpo-git' 'hyprland-plugin-hyprscrolling-git' 'hyprland-plugin-hyprtrails-git' 'hyprland-plugin-hyprwinwrap-git' 'hyprland-plugin-xtra-dispatchers-git') | |
pkgbase='hyprland-plugins-git' | |
pkgver=0.49.0.115.gdd33128c2 | |
pkgrel=1 | |
pkgdesc='Official plugins for Hyprland pointing to latest git commit' | |
arch=('x86_64') | |
url='https://github.com/hyprwm/hyprland-plugins' | |
license=('BSD') | |
depends=('hyprland-git') | |
conflicts=( 'hyprland-plugins' 'hyprland-plugin-borders-plus-plus' 'hyprland-plugin-csgo-vulkan-fix' 'hyprland-plugin-hyprbars' 'hyprland-plugin-hyprexpo' 'hyprland-plugin-hyprscrolling' 'hyprland-plugin-hyprtrails' 'hyprland-plugin-hyprwinwrap' 'hyprland-plugin-xtra-dispatchers') | |
makedepends=('git' 'hyprland-git') | |
source=("$pkgbase::git+https://github.com/hyprwm/hyprland-plugins.git#branch=main") | |
sha256sums=('SKIP') | |
pkgver() { | |
cd "$srcdir/$pkgbase" | |
# Get the Hyprland version tag directly from hyprland -v output | |
if command -v hyprland >/dev/null 2>&1; then | |
local hypr_tag=$(hyprland -v 2>/dev/null | grep -oP 'Tag: \K[^,]+' | sed 's/^v//;s/-/./g') | |
if [[ -n "$hypr_tag" ]]; then | |
echo "$hypr_tag" | |
return 0 | |
fi | |
fi | |
# Fallback to git if hyprland command fails | |
local git_version=$(git describe --long --tags --abbrev=7 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') | |
# If git describe fails, fallback to commit count and short hash | |
if [[ -z "$git_version" ]]; then | |
git_version="r$(git rev-list --count HEAD).g$(git rev-parse --short=7 HEAD)" | |
fi | |
echo "$git_version" | |
} | |
build() { | |
cd "$srcdir/$pkgbase" | |
# Set pipefail to catch errors but continue with other plugins | |
set +e # Don't exit on error | |
for package in ${pkgname[@]}; do | |
plugin=${package##hyprland-plugin-} | |
plugin=${plugin%%-git} | |
echo "Building plugin: $plugin" | |
if make -C "$plugin" all 2>&1; then | |
echo "SUCCESS: Plugin '$plugin' built successfully." | |
else | |
echo "WARNING: Failed to build plugin '$plugin'. This is normal during Hyprland updates." | |
echo "The plugin will be skipped in this build. Update again later when compatible." | |
fi | |
done | |
set -e # Re-enable exit on error for safety | |
# Always return success - partial builds are acceptable | |
return 0 | |
} | |
package_hyprland-plugin-borders-plus-plus-git() { | |
pkgdesc="A Hyprland plugin that adds one or two additional borders to your windows" | |
cd "$srcdir/$pkgbase/borders-plus-plus" | |
if [[ -f borders-plus-plus.so ]]; then | |
install -Dm755 borders-plus-plus.so "$pkgdir/usr/lib/libhyprbordersplusplus.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-borders-plus-plus/LICENSE" | |
else | |
echo "Plugin borders-plus-plus failed to build - skipping package creation" | |
return 0 | |
fi | |
} | |
package_hyprland-plugin-csgo-vulkan-fix-git() { | |
pkgdesc="A Hyprland plugin that fixes custom resolutions on CS:GO with -vulkan" | |
cd "$srcdir/$pkgbase/csgo-vulkan-fix" | |
if [[ -f csgo-vulkan-fix.so ]]; then | |
install -Dm755 csgo-vulkan-fix.so "$pkgdir/usr/lib/libhyprcsgo.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-csgo-vulkan-fix/LICENSE" | |
else | |
echo "Plugin csgo-vulkan-fix failed to build - skipping package creation" | |
return 0 | |
fi | |
} | |
package_hyprland-plugin-hyprbars-git() { | |
pkgdesc="A Hyprland plugin that adds simple title bars to windows" | |
cd "$srcdir/$pkgbase/hyprbars" | |
if [[ -f hyprbars.so ]]; then | |
install -Dm755 hyprbars.so "$pkgdir/usr/lib/libhyprbars.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-hyprbars/LICENSE" | |
else | |
echo "Plugin hyprbars failed to build - skipping package creation" | |
return 0 | |
fi | |
} | |
package_hyprland-plugin-hyprexpo-git() { | |
pkgdesc="A Hyprland plugin that adds an expo-like workspace overview" | |
cd "$srcdir/$pkgbase/hyprexpo" | |
if [[ -f hyprexpo.so ]]; then | |
install -Dm755 hyprexpo.so "$pkgdir/usr/lib/libhyprexpo.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-hyprexpo/LICENSE" | |
else | |
echo "Plugin hyprexpo failed to build - skipping package creation" | |
return 0 | |
fi | |
} | |
package_hyprland-plugin-hyprscrolling-git() { | |
pkgdesc="A Hyprland plugin that adds a scrolling layout" | |
cd "$srcdir/$pkgbase/hyprscrolling" | |
if [[ -f hyprscrolling.so ]]; then | |
install -Dm755 hyprscrolling.so "$pkgdir/usr/lib/libhyprscrolling.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-hyprscrolling/LICENSE" | |
else | |
echo "Plugin hyprscrolling failed to build - skipping package creation" | |
return 0 | |
fi | |
} | |
package_hyprland-plugin-hyprtrails-git() { | |
pkgdesc="A Hyprland plugin that adds smooth trails behind moving windows" | |
cd "$srcdir/$pkgbase/hyprtrails" | |
if [[ -f hyprtrails.so ]]; then | |
install -Dm755 hyprtrails.so "$pkgdir/usr/lib/libhyprtrails.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-hyprtrails/LICENSE" | |
else | |
echo "Plugin hyprtrails failed to build - skipping package creation" | |
return 0 | |
fi | |
} | |
package_hyprland-plugin-hyprwinwrap-git() { | |
pkgdesc="A Hyprland clone of xwinwrap that allows you to put any app as a wallpaper" | |
cd "$srcdir/$pkgbase/hyprwinwrap" | |
if [[ -f hyprwinwrap.so ]]; then | |
install -Dm755 hyprwinwrap.so "$pkgdir/usr/lib/libhyprwinwrap.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-hyprwinwrap/LICENSE" | |
else | |
echo "Plugin hyprwinwrap failed to build - skipping package creation" | |
return 0 | |
fi | |
} | |
package_hyprland-plugin-xtra-dispatchers-git() { | |
pkgdesc="A Hyprland plugin that adds some additional dispatchers." | |
cd "$srcdir/$pkgbase/xtra-dispatchers" | |
if [[ -f xtra-dispatchers.so ]]; then | |
install -Dm755 xtra-dispatchers.so "$pkgdir/usr/lib/libxtradispatchers.so" | |
install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/hyprland-plugin-xtra-dispatchers/LICENSE" | |
else | |
echo "Plugin xtra-dispatchers failed to build - skipping package creation" | |
return 0 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment