From 522f28e24fb6d5f5860ab4f4da342906181c3c92 Mon Sep 17 00:00:00 2001 From: Stewart Wong Date: Sat, 20 Dec 2025 16:36:55 +0000 Subject: [PATCH] Update to 0.5.0 --- .SRCINFO | 2 +- PKGBUILD | 2 +- hamr.install | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 406c10a26806..a4a5f82542c4 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = hamr pkgdesc = Extensible launcher for Hyprland built with Quickshell - pkgver = 0.4.1 + pkgver = 0.5.0 pkgrel = 1 url = https://github.com/Stewart86/hamr arch = any diff --git a/PKGBUILD b/PKGBUILD index 99f686c3ec2c..b893f6e49709 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Stewart Wong pkgname=hamr -pkgver=0.4.1 +pkgver=0.5.0 pkgrel=1 pkgdesc='Extensible launcher for Hyprland built with Quickshell' arch=('any') diff --git a/hamr.install b/hamr.install index 86ec710f0383..1177cd9b4757 100644 --- a/hamr.install +++ b/hamr.install @@ -32,6 +32,29 @@ post_install() { 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" + echo "==> Migrated: removed default prefix config (now using actionBarHints)" + fi + fi + fi + echo "" echo "==> Hamr has been upgraded." echo "==> Restart quickshell to apply changes."