diff --git a/pkgbuilds/omakeyboard/.omarchy/package.json b/pkgbuilds/omakeyboard/.omarchy/package.json new file mode 100644 index 00000000..15a9e445 --- /dev/null +++ b/pkgbuilds/omakeyboard/.omarchy/package.json @@ -0,0 +1,9 @@ +{ + "source": "local", + "upstream": { + "watch": { + "github": "gabamnml/omakeyboard", + "pattern": "v(?P[0-9]+(?:\\.[0-9]+)*)" + } + } +} diff --git a/pkgbuilds/omakeyboard/PKGBUILD b/pkgbuilds/omakeyboard/PKGBUILD new file mode 100644 index 00000000..524b3822 --- /dev/null +++ b/pkgbuilds/omakeyboard/PKGBUILD @@ -0,0 +1,63 @@ +# Maintainer: Gabriel Aramburu + +pkgname=omakeyboard +pkgver=0.1.0 +pkgrel=1 +pkgdesc='Keyboard remapping and shortcuts for Omarchy, built with Qt Quick' +arch=('x86_64' 'aarch64') +url='https://github.com/gabamnml/omakeyboard' +license=('MIT') +install='omakeyboard.install' +options=('!debug') + +# hyprland and lua are runtime tools, not linked: hyprctl applies the +# changes, and lua reads the bindings already in the configuration. +depends=( + 'hicolor-icon-theme' + 'hyprland' + 'libxkbcommon' + 'lua' + 'qt6-base' + 'qt6-declarative' + 'qt6-wayland' +) +makedepends=( + 'gcc' + 'make' + 'qt6-base' + 'qt6-declarative' +) +checkdepends=( + 'qt6-base' + 'qt6-declarative' +) +optdepends=('xdg-desktop-portal: follow the desktop dark mode and text scale, and use the desktop file chooser when exporting or importing') + +source=("$pkgname-$pkgver.tar.gz::https://github.com/gabamnml/omakeyboard/archive/refs/tags/v$pkgver.tar.gz") +sha256sums=('3cc272c47cd0670b6d475e058fafbfbe264555780e7442c357428bbf1b7282a6') + +build() { + cd "$srcdir/$pkgname-$pkgver" + ./bin/build +} + +check() { + cd "$srcdir/$pkgname-$pkgver" + ./bin/test +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + install -Dm755 build/omakeyboard "$pkgdir/usr/bin/omakeyboard" + install -Dm644 packaging/omakeyboard.desktop \ + "$pkgdir/usr/share/applications/omakeyboard.desktop" + for size in 16 22 24 32 48 64 96 128 256 512; do + install -Dm644 "resources/icons/${size}.png" \ + "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/omakeyboard.png" + done + install -Dm644 resources/wordmark.svg \ + "$pkgdir/usr/share/omakeyboard/wordmark.svg" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md" +} diff --git a/pkgbuilds/omakeyboard/omakeyboard.install b/pkgbuilds/omakeyboard/omakeyboard.install new file mode 100644 index 00000000..c4be03c7 --- /dev/null +++ b/pkgbuilds/omakeyboard/omakeyboard.install @@ -0,0 +1,24 @@ +post_install() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor >/dev/null 2>&1 || true + update-desktop-database -q >/dev/null 2>&1 || true +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install + + cat <<'MESSAGE' +OmaKeyboard has been removed, but the configuration it generated is still in place: + + ~/.config/omakeyboard/ your rules and the generated data + ~/.config/hypr/omakeyboard.lua the loader + ~/.local/state/omakeyboard/ generated keymaps and backups + +and hyprland.lua still requires the loader. To undo all of that, run +"Restore defaults" in the app before uninstalling, or remove the block +marked OmaKeyboard from ~/.config/hypr/hyprland.lua by hand. +MESSAGE +}