Update to v1.0.0 - Rust rewrite

This commit is contained in:
Stewart Wong 2026-01-27 18:11:43 +08:00
parent 2aa5b10610
commit 0d3a1876ad
No known key found for this signature in database
3 changed files with 137 additions and 180 deletions

View file

@ -1,43 +1,33 @@
pkgbase = hamr
pkgdesc = Extensible launcher for Hyprland and Niri built with Quickshell
pkgver = 0.17.11
pkgdesc = A fast, extensible desktop launcher for Linux
pkgver = 1.0.0
pkgrel = 1
url = https://github.com/Stewart86/hamr
arch = any
license = GPL-3.0-or-later
depends = quickshell
depends = qt6-5compat
arch = x86_64
license = MIT
makedepends = rust
makedepends = cargo
makedepends = pkgconf
depends = gtk4
depends = gtk4-layer-shell
depends = python
depends = python-click
depends = python-loguru
depends = python-tqdm
depends = python-gobject
depends = gnome-desktop-4
depends = wl-clipboard
depends = cliphist
depends = fd
depends = fzf
depends = xdg-utils
depends = libnotify
depends = gtk3
depends = libpulse
depends = jq
depends = libqalculate
depends = ttf-material-symbols-variable
depends = ttf-jetbrains-mono-nerd
optdepends = hyprland: Hyprland compositor support
optdepends = niri: Niri compositor support
optdepends = ttf-readex-pro: Reading font for cards (AUR)
optdepends = matugen: Material You color generation from wallpapers
optdepends = tesseract: OCR text extraction for screenshot search
optdepends = tesseract-data-eng: English OCR language data
optdepends = imagemagick: Alternative thumbnail generation
optdepends = python-dbus: system dbus integration for plugins
optdepends = python-gobject: GObject introspection for plugins
optdepends = wl-clipboard: clipboard operations in plugins
optdepends = xdg-utils: desktop integration (xdg-open)
optdepends = glib2: file operations (gio trash)
optdepends = grim: screenshot capture
optdepends = slurp: screen region selection
optdepends = wf-recorder: screen recording
optdepends = swww: animated wallpapers (wallpaper plugin)
optdepends = awww: wallpaper management
optdepends = playerctl: media player control (player plugin)
optdepends = bitwarden-cli: Bitwarden password manager integration
optdepends = python-keyring: Secure session storage for Bitwarden plugin
optdepends = slurp: Screen region selection for screenshots
optdepends = wf-recorder: Screen recording
replaces = hamr-qml
install = hamr.install
source = git+https://github.com/Stewart86/hamr.git
source = hamr-1.0.0::git+https://github.com/Stewart86/hamr.git#tag=v1.0.0
sha256sums = SKIP
pkgname = hamr

129
PKGBUILD
View file

@ -1,79 +1,84 @@
# Maintainer: Stewart Wong <siwei.wong@gmail.com>
# Maintainer: Stewart <stewart@anomaly.co>
# AUR package for hamr - builds from source
pkgname=hamr
# Version is injected by CI from VERSION file during release
pkgver=0.17.11
pkgver=1.0.0
pkgrel=1
pkgdesc='Extensible launcher for Hyprland and Niri built with Quickshell'
arch=('any')
url='https://github.com/Stewart86/hamr'
license=('GPL-3.0-or-later')
pkgdesc="A fast, extensible desktop launcher for Linux"
arch=('x86_64')
url="https://github.com/Stewart86/hamr"
license=('MIT')
depends=(
# Core (quickshell is in extra repo)
'quickshell'
'qt6-5compat'
# Python runtime
'gtk4'
'gtk4-layer-shell'
'python'
'python-click'
# Thumbnail generation
'python-loguru'
'python-tqdm'
'python-gobject'
'gnome-desktop-4'
# Clipboard
'wl-clipboard'
'cliphist'
# File search
'fd'
'fzf'
# Desktop integration
'xdg-utils'
'libnotify'
'gtk3'
'libpulse'
'jq'
# Calculator
'libqalculate'
# Fonts
# Fonts required for UI
'ttf-material-symbols-variable'
'ttf-jetbrains-mono-nerd'
)
optdepends=(
'hyprland: Hyprland compositor support'
'niri: Niri compositor support'
'ttf-readex-pro: Reading font for cards (AUR)'
'matugen: Material You color generation from wallpapers'
'tesseract: OCR text extraction for screenshot search'
'tesseract-data-eng: English OCR language data'
'imagemagick: Alternative thumbnail generation'
'bitwarden-cli: Bitwarden password manager integration'
'python-keyring: Secure session storage for Bitwarden plugin'
'slurp: Screen region selection for screenshots'
'wf-recorder: Screen recording'
'ocean-sound-theme: Modern sound effects for timer/alarm (recommended)'
'sound-theme-freedesktop: Fallback sound effects'
makedepends=(
'rust'
'cargo'
'pkgconf'
)
optdepends=(
'python-dbus: system dbus integration for plugins'
'python-gobject: GObject introspection for plugins'
# Desktop integration tools for plugins
'wl-clipboard: clipboard operations in plugins'
'xdg-utils: desktop integration (xdg-open)'
'glib2: file operations (gio trash)'
# Screenshot plugins
'grim: screenshot capture'
'slurp: screen region selection'
# Screen recording
'wf-recorder: screen recording'
# Wallpaper
'swww: animated wallpapers (wallpaper plugin)'
'awww: wallpaper management'
# Media player control
'playerctl: media player control (player plugin)'
# Bitwarden integration
'bitwarden-cli: Bitwarden password manager integration'
)
replaces=('hamr-qml')
install=hamr.install
source=("$pkgname-$pkgver::git+${url}.git#tag=v${pkgver}")
sha256sums=('SKIP')
install=hamr.install
build() {
cd "$pkgname-$pkgver"
export CARGO_TARGET_DIR=target
cargo build --release --locked
}
package() {
cd "$srcdir/$pkgname-$pkgver"
cd "$pkgname-$pkgver"
# Install to /etc/xdg/quickshell/hamr (system-wide quickshell config)
install -dm755 "$pkgdir/etc/xdg/quickshell/$pkgname"
cp -r modules services plugins scripts assets defaults "$pkgdir/etc/xdg/quickshell/$pkgname/"
cp *.qml "$pkgdir/etc/xdg/quickshell/$pkgname/"
# Install binaries
install -Dm755 target/release/hamr "$pkgdir/usr/bin/hamr"
install -Dm755 target/release/hamr-daemon "$pkgdir/usr/bin/hamr-daemon"
install -Dm755 target/release/hamr-gtk "$pkgdir/usr/bin/hamr-gtk"
install -Dm755 target/release/hamr-tui "$pkgdir/usr/bin/hamr-tui"
# Install hamr command
install -Dm755 hamr "$pkgdir/usr/bin/$pkgname"
# Install plugins to system location
install -dm755 "$pkgdir/usr/share/hamr/plugins"
cp -r plugins/* "$pkgdir/usr/share/hamr/plugins/"
# Install systemd user service (for Niri and other systemd-based compositors)
install -Dm644 hamr.service "$pkgdir/usr/lib/systemd/user/hamr.service"
# Fix permissions on plugin files
find "$pkgdir/usr/share/hamr/plugins" -type f -name "*.py" -exec chmod 755 {} \;
find "$pkgdir/usr/share/hamr/plugins" -type f -name "*.json" -exec chmod 644 {} \;
# Install license
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Install documentation
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

View file

@ -1,101 +1,63 @@
post_install() {
local config_dir="$HOME/.config/hamr"
local state_dir="$HOME/.local/state/quickshell/hamr"
mkdir -p "$config_dir"
mkdir -p "$state_dir"
if [ ! -f "$config_dir/colors.json" ]; then
cp /etc/xdg/quickshell/hamr/defaults/colors.json "$config_dir/colors.json"
fi
echo ""
echo "==> Hamr has been installed to /etc/xdg/quickshell/hamr"
echo "==> Hamr v1.0.0 installed successfully!"
echo ""
echo "==> To start hamr, run:"
echo " hamr"
echo " Start the daemon: hamr-daemon"
echo " Launch the UI: hamr-gtk"
echo ""
echo "==> User config and plugins: ~/.config/hamr/"
echo "==> Persistent state: ~/.local/state/quickshell/hamr/"
echo ""
echo "==> Color theme:"
echo " Edit ~/.config/hamr/colors.json directly, or"
echo " configure matugen/wallust to output to this path, or"
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 "==> For Hyprland, add to ~/.config/hypr/hyprland.conf:"
echo " exec-once = hamr"
echo " bind = Ctrl, Space, exec, hamr toggle"
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 \"hamr\" \"toggle\"; }"
echo ""
echo "==> Troubleshooting:"
echo " View logs: journalctl --user -u hamr -f"
echo " Qt mismatch crash? Rebuild: paru -S quickshell --rebuild"
echo " Plugins are installed to: /usr/share/hamr/plugins/"
echo " User config location: ~/.config/hamr/"
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"
echo "==> Migrated: removed default prefix config (now using actionBarHints)"
fi
fi
if [[ "$(vercmp "$2" "1.0.0")" -lt 0 ]]; then
echo ""
echo "=========================================="
echo " HAMR v1.0.0 - MAJOR VERSION UPGRADE"
echo "=========================================="
echo ""
echo " Hamr has been completely rewritten in Rust!"
echo ""
echo " BREAKING CHANGES:"
echo " - License changed from GPL-3.0 to MIT"
echo " - QML/Quickshell replaced with native GTK4"
echo " - New plugin system with Python SDK"
echo " - Different configuration format"
echo ""
echo " CLEANUP (optional):"
echo " Old QML files may remain at:"
echo " /etc/xdg/quickshell/hamr/"
echo " ~/.config/quickshell/"
echo ""
echo " You can safely remove these if not using"
echo " other Quickshell applications."
echo ""
echo " NEW COMMANDS:"
echo " hamr-daemon - Background service"
echo " hamr-gtk - GTK4 launcher UI"
echo " hamr-tui - Terminal UI (optional)"
echo " hamr - CLI tools"
echo ""
echo " For migration help, visit:"
echo " https://github.com/Stewart86/hamr"
echo ""
echo "=========================================="
echo ""
else
echo ""
echo "==> Hamr upgraded to v$1"
echo ""
fi
# Restart hamr after upgrade (was stopped in pre_remove)
# Install scripts run as root, so we need to find logged-in users
for user in $(loginctl list-users --no-legend 2>/dev/null | awk '{print $2}'); do
systemctl --machine="$user@.host" --user start hamr.service 2>/dev/null || true
done
echo ""
echo "==> Hamr has been upgraded and restarted."
echo ""
echo "==> If hamr crashes after a Qt update, rebuild quickshell:"
echo " paru -S quickshell --rebuild"
echo ""
}
pre_upgrade() {
# Stop hamr before files are extracted to prevent crash from file watcher
# Install scripts run as root, so we need to find logged-in users
for user in $(loginctl list-users --no-legend 2>/dev/null | awk '{print $2}'); do
systemctl --machine="$user@.host" --user stop hamr.service 2>/dev/null || true
done
}
post_remove() {
# Disable systemd service if enabled
for user in $(loginctl list-users --no-legend 2>/dev/null | awk '{print $2}'); do
systemctl --machine="$user@.host" --user disable hamr.service 2>/dev/null || true
done
echo ""
echo "==> User data has been preserved. Remove manually if no longer needed:"
echo " rm -rf ~/.config/hamr"
echo " rm -rf ~/.local/state/quickshell/hamr"
echo "==> Hamr has been removed."
echo ""
echo " User data remains at: ~/.config/hamr/"
echo " ~/.local/share/hamr/"
echo ""
echo " Remove these manually if no longer needed."
echo ""
}