diff --git a/.SRCINFO b/.SRCINFO index 36b7e8891ce1..ed6e0f4dd030 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = hamr pkgdesc = Extensible launcher for Hyprland built with Quickshell - pkgver = 0.9.0 + pkgver = 0.10.0 pkgrel = 1 url = https://github.com/Stewart86/hamr arch = any diff --git a/PKGBUILD b/PKGBUILD index 7aa9ca9e511d..5f5fb19ede6d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,8 +1,8 @@ # Maintainer: Stewart Wong pkgname=hamr -pkgver=0.9.0 +pkgver=0.10.0 pkgrel=1 -pkgdesc='Extensible launcher for Hyprland built with Quickshell' +pkgdesc='Extensible launcher for Wayland compositors built with Quickshell' arch=('any') url='https://github.com/Stewart86/hamr' license=('GPL-3.0-or-later') @@ -33,7 +33,6 @@ depends=( 'xdg-utils' 'libnotify' 'gtk3' - 'hyprland' 'libpulse' 'jq' @@ -45,6 +44,8 @@ depends=( 'ttf-jetbrains-mono-nerd' ) optdepends=( + 'hyprland: Hyprland compositor support' + 'niri: Niri compositor support' 'ttf-readex-pro: Reading font for cards (AUR)' 'tesseract: OCR text extraction for screenshot search' 'tesseract-data-eng: English OCR language data' @@ -71,4 +72,7 @@ package() { #!/bin/bash exec qs -c hamr "$@" EOF + + # Install systemd user service (for Niri and other systemd-based compositors) + install -Dm644 hamr.service "$pkgdir/usr/lib/systemd/user/hamr.service" } diff --git a/hamr.install b/hamr.install index 1177cd9b4757..fa751c370cc8 100644 --- a/hamr.install +++ b/hamr.install @@ -23,38 +23,44 @@ post_install() { echo " symlink to your existing colors (e.g. for end-4/dots-hyprland):" echo " ln -sf ~/.local/state/quickshell/user/generated/colors.json ~/.config/hamr/colors.json" echo "" - echo "==> Add to your Hyprland config:" + echo "==> For Hyprland, add to ~/.config/hypr/hyprland.conf:" echo " exec-once = hamr" echo " bind = Ctrl, Space, global, quickshell:hamrToggle" echo "" + echo "==> For Niri, enable the systemd service and add keybind:" + echo " systemctl --user enable hamr.service" + echo " systemctl --user add-wants niri.service hamr.service" + echo " systemctl --user start hamr.service" + echo "" + echo " # Add to ~/.config/niri/config.kdl binds section:" + echo " Ctrl+Space { spawn \"qs\" \"ipc\" \"call\" \"hamr\" \"toggle\"; }" + echo "" } - - post_upgrade() { local config_file="$HOME/.config/hamr/hamr.json" - + # Migrate: remove old prefix config if it matches system defaults if [ -f "$config_file" ]; then local default_prefix='{"action":"/","app":">","clipboard":";","emojis":":","file":"~","math":"=","shellCommand":"$","shellHistory":"!","webSearch":"?"}' local current_prefix current_prefix=$(jq -c '.search.prefix // empty' "$config_file" 2>/dev/null) - + if [ -n "$current_prefix" ]; then # Normalize both for comparison (sort keys) local current_sorted local default_sorted current_sorted=$(echo "$current_prefix" | jq -cS '.' 2>/dev/null) default_sorted=$(echo "$default_prefix" | jq -cS '.' 2>/dev/null) - + if [ "$current_sorted" = "$default_sorted" ]; then # Remove the old prefix config since it's the default - jq 'del(.search.prefix)' "$config_file" > "$config_file.tmp" && mv "$config_file.tmp" "$config_file" + jq 'del(.search.prefix)' "$config_file" >"$config_file.tmp" && mv "$config_file.tmp" "$config_file" echo "==> Migrated: removed default prefix config (now using actionBarHints)" fi fi fi - + echo "" echo "==> Hamr has been upgraded." echo "==> Restart quickshell to apply changes." @@ -62,6 +68,9 @@ post_upgrade() { } post_remove() { + # Disable systemd service if enabled + systemctl --user disable hamr.service 2>/dev/null || true + echo "" echo "==> User data has been preserved. Remove manually if no longer needed:" echo " rm -rf ~/.config/hamr"