diff --git a/.SRCINFO b/.SRCINFO index d8f26c562187..4d1525dcde6c 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,12 +1,19 @@ pkgbase = hyprwhspr pkgdesc = Native Whisper speech-to-text for Arch/Omarchy with Waybar integration - pkgver = 1.1.0 + pkgver = 1.2.0 pkgrel = 1 url = https://github.com/goodroot/hyprwhspr install = hyprwhspr.install arch = x86_64 license = MIT depends = python + depends = python-evdev + depends = python-numpy + depends = python-scipy + depends = python-pyperclip + depends = python-psutil + depends = python-rich + depends = python-json5 depends = ydotool depends = pipewire depends = pipewire-alsa @@ -18,7 +25,7 @@ pkgbase = hyprwhspr depends = base-devel optdepends = nvidia-utils: For GPU acceleration optdepends = cuda: For GPU acceleration - source = hyprwhspr-1.1.0.tar.gz::https://github.com/goodroot/hyprwhspr/archive/v1.1.0.tar.gz - sha256sums = 60e704c87894f488f32a434e037c0ded22f3dfdbbf056c8a7e5ca32a74790156 + source = hyprwhspr-1.2.0.tar.gz::https://github.com/goodroot/hyprwhspr/archive/v1.2.0.tar.gz + sha256sums = ac063f5c43da89e89b65230b5a7e70533019ae9274c118c37b62c636ef63cf92 pkgname = hyprwhspr diff --git a/PKGBUILD b/PKGBUILD index 261df6279af9..a8832062e410 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: goodroot pkgname=hyprwhspr -pkgver=1.1.0 +pkgver=1.2.0 pkgrel=1 pkgdesc="Native Whisper speech-to-text for Arch/Omarchy with Waybar integration" arch=('x86_64') @@ -9,6 +9,13 @@ url="https://github.com/goodroot/hyprwhspr" license=('MIT') depends=( 'python' + 'python-evdev' + 'python-numpy' + 'python-scipy' + 'python-pyperclip' + 'python-psutil' + 'python-rich' + 'python-json5' 'ydotool' 'pipewire' 'pipewire-alsa' @@ -29,7 +36,7 @@ source=( "${pkgname}-${pkgver}.tar.gz::https://github.com/goodroot/${pkgname}/archive/v${pkgver}.tar.gz" ) sha256sums=( - '60e704c87894f488f32a434e037c0ded22f3dfdbbf056c8a7e5ca32a74790156' + 'ac063f5c43da89e89b65230b5a7e70533019ae9274c118c37b62c636ef63cf92' ) package() { @@ -45,6 +52,13 @@ package() { chmod +x "${pkgdir}/opt/${pkgname}/scripts/"*.sh chmod +x "${pkgdir}/opt/${pkgname}/bin/hyprwhspr" + # Create Python virtual environment and install pip-only dependencies + cd "${pkgdir}/opt/${pkgname}" + python -m venv venv + source venv/bin/activate + pip install --upgrade pip + pip install sounddevice # Only dependency not available in Arch repos + # Create symlink for easy access install -dm755 "${pkgdir}/usr/bin" ln -sf "/opt/${pkgname}/bin/hyprwhspr" "${pkgdir}/usr/bin/hyprwhspr" diff --git a/hyprwhspr.install b/hyprwhspr.install index f36d01d766c3..73b013b00462 100644 --- a/hyprwhspr.install +++ b/hyprwhspr.install @@ -1,20 +1,24 @@ post_install() { echo "HyprWhspr has been installed to /opt/hyprwhspr/" echo "" - echo "Running automatic setup..." + echo "Running setup script to configure permissions and services..." - # Run the installation script automatically + # Run the installation script as the installing user if [ -f "/opt/hyprwhspr/scripts/install-omarchy.sh" ]; then - echo "Executing installation script..." - cd /opt/hyprwhspr - ./scripts/install-omarchy.sh + INSTALLING_USER="${SUDO_USER:-$USER}" + echo "Executing setup as user: $INSTALLING_USER" + + # Run the script as the user (it will use sudo internally when needed) + # Set environment variable to make it non-interactive for AUR + sudo -u "$INSTALLING_USER" env HYPRWHSPR_AUR_INSTALL=1 /opt/hyprwhspr/scripts/install-omarchy.sh + echo "" echo "✅ HyprWhspr setup completed successfully!" echo "" - echo "⚠️ IMPORTANT: Log out and back in to ensure proper permissions" + echo "⚠️ IMPORTANT: Log out and back in for group changes to take effect" echo " Then use Super+Alt+D to start dictation!" else - echo "❌ Installation script not found. Please run manually:" + echo "❌ Setup script not found. Please run manually:" echo " /opt/hyprwhspr/scripts/install-omarchy.sh" fi @@ -25,19 +29,27 @@ post_install() { post_upgrade() { echo "HyprWhspr has been upgraded successfully!" echo "" - echo "Running automatic setup update..." + echo "Re-running setup to update configuration..." # Re-run the installation script to update components if [ -f "/opt/hyprwhspr/scripts/install-omarchy.sh" ]; then - echo "Updating whisper.cpp and dependencies..." - cd /opt/hyprwhspr - ./scripts/install-omarchy.sh + INSTALLING_USER="${SUDO_USER:-$USER}" + sudo -u "$INSTALLING_USER" env HYPRWHSPR_AUR_INSTALL=1 /opt/hyprwhspr/scripts/install-omarchy.sh echo "" echo "✅ HyprWhspr update completed successfully!" - echo "" - echo "⚠️ IMPORTANT: Log out and back in to ensure proper permissions" else - echo "❌ Installation script not found. Please run manually:" + echo "❌ Setup script not found. Please run manually:" echo " /opt/hyprwhspr/scripts/install-omarchy.sh" fi } + +pre_remove() { + echo "Stopping HyprWhspr services..." + + # Stop services gracefully + INSTALLING_USER="${SUDO_USER:-$USER}" + sudo -u "$INSTALLING_USER" systemctl --user stop hyprwhspr.service 2>/dev/null || true + sudo -u "$INSTALLING_USER" systemctl --user stop ydotoold.service 2>/dev/null || true + + echo "✅ Services stopped" +}