Commit Graph
28 Commits
Author SHA1 Message Date
Jatin K MalikandGitHub f2e13bbcba feat: Phase 2 - Enhanced distro detection and package manager support (#159)
Add support for 5 additional Linux distribution families:

**New Distribution Detection:**
- Gentoo (Portage package manager)
- Alpine Linux (apk package manager)
- Void Linux (xbps package manager)
- Solus (eopkg package manager)
- Mageia (dnf/urpmi package managers)

**Changes:**
- Enhanced `detect_distro()` to detect Gentoo, Alpine, Void, Solus, Mageia
- Added package definitions for each new distribution in `install_system_dependencies()`
- Added full installation case statements with package verification
- Updated `install_python_dependencies()` to handle virtual environment creation for new distros
- Updated `install_text_input_tools()` for both Wayland and X11 sessions
- Updated unknown session type fallback with all new distributions

**Package Manager Support:**
- emerge: Gentoo's Portage (compiles from source)
- apk: Alpine's package manager (musl libc)
- xbps: Void Linux's package manager
- eopkg: Solus's package manager
- dnf/urpmi: Mageia's package managers

Part of cross-distribution compatibility improvements (Phase 2 of 5).
Related to #157
2026-02-07 16:35:40 -08:00
Jatin K MalikandGitHub 2b498f0888 fix: Phase 1 - Critical cross-distribution compatibility fixes (#158)
* fix: Phase 1 - Critical cross-distribution compatibility fixes

This commit implements the first phase of cross-distribution compatibility
improvements for Vocalinux, addressing the most critical issues that prevent
the application from working on non-Ubuntu distributions.

## Changes

### install.sh
- Add detect_typelib_path() function that dynamically discovers GI_TYPELIB_PATH
  using pkg-config with fallback to distribution-specific paths
- Update wrapper scripts (vocalinux, vocalinux-gui) to use detected path
- Support for: x86_64, arm64, armhf, riscv64, powerpc64le, s390x architectures
- Specific paths for: Ubuntu multiarch, Fedora/RHEL (lib64), Arch (lib)

### src/vocalinux/speech_recognition/recognition_manager.py
- Add _get_system_model_paths() function for dynamic model path discovery
- Enhance ALSA library detection with multiple library name fallbacks:
  - libasound.so.2, libasound.so, libasound.so.0, asound
- Support XDG_DATA_DIRS environment variable for model paths
- Distribution-specific paths for Fedora/RHEL/CentOS/Rocky/AlmaLinux
- Arch-specific handling (excludes /usr/local)

### src/vocalinux/utils/resource_manager.py
- Enhanced _find_resources_dir() with more candidate paths
- Support for XDG_DATA_DIRS environment variable
- Add lib64 and lib paths for Fedora/RHEL distributions
- Add Flatpak-specific path (/app/share/vocalinux/resources)

## Testing

All 462 existing tests pass.

## Related Issues

Fixes #157 (partial - Phase 1 of 5)

* chore: Remove analysis docs from PR, add to .gitignore

* style: Apply black formatting to pass lint checks
2026-02-07 16:26:49 -08:00
Jatin K MalikandGitHub 2becfb5a98 fix(install): fix model download and VOSK-only option in interactive mode (#132)
* fix(install): fix model download and VOSK-only option in interactive mode

- Add missing option 3 handling in interactive prompt to create VOSK
  config when user selects VOSK-only mode (mirrors --no-whisper flag)
- Set WITH_WHISPER and WHISPER_CPU flags correctly for options 1 and 2
- Fix Whisper model download logic to check actual installation status
  using venv python instead of relying on unreliable flag combinations
- Always download Whisper tiny model when Whisper is installed since
  it's the default engine in config_manager.py
- Add informative messages about model download status

Fixes issues where:
1. Selecting option 2 or 3 didn't properly configure the system
2. Whisper tiny model wasn't downloaded even when Whisper was selected
3. App defaulted to Whisper engine but model wasn't available

* fix(install): use explicit venv python path and simplify condition

- Use $VENV_DIR/bin/python instead of bare 'python' in run_tests() and
  verify_installation() for consistency and reliability
- Simplify Whisper install condition since WITH_WHISPER is already set
  by auto-detection in non-interactive mode (lines 412-424)
- Update comments to better explain the logic flow

* style(install): restore ASCII art logo and improve formatting

- Restore beautiful VOCALINUX ASCII art banner in interactive installer
- Restore ASCII art banner in installation complete message
- Use Unicode box-drawing characters (━) for section separators
- Use bullet points (•) instead of dashes for lists
- Add colored terminal output for commands
- Add star emoji for GitHub link

* style(install): show ASCII art banner in all installation modes

The ASCII art logo is now displayed at the start of installation
regardless of mode (interactive, curl|bash, or with flags).

* fix(install): remove duplicate ASCII art in interactive mode

The ASCII art banner is now shown once at script start for all modes.
Remove the duplicate from run_interactive_install() to avoid showing
it twice when running with -i/--interactive flag.

* docs(install): rename options to 'Full install' and 'Minimal install'

Clarify that VOSK is always installed as a fallback engine:
- 'Full install' = Whisper + VOSK (recommended, highest accuracy)
- 'Minimal install' = VOSK only (lightweight, ~40MB)

Updates both the -i interactive installer and the fallback prompt.
Also improves the installation summary display.

* fix(install): update desktop database so app appears in menu immediately

Previously only the icon cache was updated after installation, but not
the desktop database. This caused the app to not appear in application
menus until the user logged out and back in (or manually ran
update-desktop-database).

Now the installer runs update-desktop-database after installing the
.desktop file, so Vocalinux appears in the app launcher immediately.
2026-02-05 13:45:26 -08:00
Jatin K MalikandGitHub ee494f921c fix(keyboard): verify Ctrl key capability in evdev backend availability check (#128)
* fix(keyboard): verify Ctrl key capability in evdev backend availability check

The evdev backend's is_available() method was incorrectly returning True
when keyboard devices were found, even if the user lacked permission to
access them or if the accessible devices didn't have Ctrl key capability.

This caused keyboard shortcuts to fail silently on Wayland when the user
wasn't in the 'input' group, as the backend was selected but couldn't
actually monitor keyboard events.

Changes:
- Add device_has_ctrl_key() helper to verify a device supports Ctrl keys
- Update is_available() to check both device accessibility AND Ctrl key
  capability
- Now correctly returns False when no usable keyboard device is found,
  triggering proper error messages about permissions

This ensures users get clear feedback about missing permissions instead
of silently non-working keyboard shortcuts.

* fix(install): use sg command to apply input group without logout

The install.sh script adds the user to the 'input' group for keyboard
shortcuts on Wayland, but this change doesn't take effect until logout.

Updated wrapper scripts to use 'sg input -c ...' to run vocalinux with
the input group applied, even if the user hasn't logged out yet. This
provides a much better user experience as keyboard shortcuts work
immediately after installation.

The wrapper detects if:
1. User is in /etc/group for 'input' group
2. Current session doesn't have the group active
If both conditions are true, it uses 'sg' to apply the group.
2026-02-05 00:04:19 -08:00
6f54dd80e0 Fix Python 3.13 and Wayland compatibility (#125)
* Fix Python 3.13 and Wayland compatibility

This commit addresses installation failures on modern Linux distributions
(Ubuntu 25.10+) with Python 3.13 and Wayland-only sessions.

Changes:

1. **Add Python 3.13 support** (pyproject.toml)
   - Add Python 3.13 to classifiers
   - Update black target versions to include py312, py313
   - No code changes needed - already compatible

2. **Use system site-packages for PyGObject** (install.sh)
   - Change venv creation to use --system-site-packages flag
   - Avoids PyGObject build failures with Python 3.13
   - System PyGObject (python3-gi) is already installed as dependency
   - Building from source is unnecessary and fragile with new Python versions

3. **Improve Wayland text injection support** (install.sh)
   - Install ydotool as fallback (wtype doesn't work with GNOME Wayland)
   - Add user to 'input' group for uinput device access
   - Install udev rule for /dev/uinput permissions
   - Provide clear warning about logout requirement

Technical details:
- wtype uses Wayland virtual keyboard protocol (not supported by GNOME)
- ydotool uses Linux uinput kernel module (works with all compositors)
- System PyGObject 3.50.0+ supports Python 3.13
- Building PyGObject 3.54.5 from source fails with Python 3.13 build tools

Fixes installation on:
- Ubuntu 25.10 (Questing Quokka) - Wayland-only, Python 3.13
- Arch Linux with Python 3.13
- Fedora 41+ with Python 3.13

Tested on: Ubuntu 25.10 with Python 3.13.7, GNOME 49 Wayland

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Prioritize ydotool over wtype for universal Wayland compatibility

wtype uses the virtual-keyboard Wayland protocol which is not supported
by GNOME/Mutter compositors. ydotool uses the Linux uinput kernel module
which works with all Wayland compositors including GNOME.

This change swaps the priority order to check ydotool first, ensuring
text injection works on GNOME Wayland (Ubuntu 25.10+) while still
falling back to wtype for compositors that support it.

Tested on Ubuntu 25.10 with GNOME 49 Wayland - text injection now works
perfectly with ydotool.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* ci: trigger workflow run

* ci: run lint/tests on python 3.13

---------

Co-authored-by: ACT900 <179795730+ACT900@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 22:31:24 -08:00
be928332c5 fix: Debian dependencies and AppIndicator fallback (#123)
* fix: Debian dependencies in install.sh
Fixes issue #102: Building on a fresh Debian installation in a VM with GNOME
required additional dependencies for pip to install. pip fails with Meson submodule
failing without cairo and girepository-2.0 development packages.

Changes:
- install.sh: Separated Debian packages from Ubuntu packages; selects Debian if found;
  otherwise same workflow for apt packages
- docs/INSTALL.md: Separated Debian installation instructions from Ubuntu, updated package list.
- src/vocalinux/main.py: Fixed comment indicating gir1.2-ayatana-appindicator3 is only for Debian
  13- it's for Debian 11+
- CONTRIBUTING.md: Separated Debian installation instructions from Ubuntu, updated package list.

* fix: fall back to Ayatana AppIndicator

---------

Co-authored-by: Tanjera <ibi.keller@gmail.com>
2026-02-04 20:59:12 -08:00
Jatin K MalikandGitHub d140146490 feat: add interactive installer with GPU auto-detection (#88)
* feat: add interactive installer with GPU auto-detection

This commit enhances the Vocalinux installation experience with:

- GPU auto-detection: Automatically detects NVIDIA GPU presence
  and selects CPU-only Whisper when no GPU is present
- New --interactive flag: Friendly guided installation for new users
  with 4-step flow (system info, engine choice, variant, models)
- Beautiful welcome message: Clear post-install instructions
  with next steps, tips, and help links
- Website updates: New interactive install section at top

Changes:
- install.sh: Add detect_nvidia_gpu(), run_interactive_install(),
  print_welcome_message() functions
- install.sh: Add INTERACTIVE_MODE, HAS_NVIDIA_GPU variables
- install.sh: Add --interactive|-i command-line flag
- install.sh: Auto-detect GPU in non-interactive mode
- web/src/app/page.tsx: Add interactiveInstallCommand section
- README.md: Add interactive install section at top

The installer now saves ~2GB of bandwidth for users without
NVIDIA GPUs by automatically selecting CPU-only PyTorch.

* fix: clarify website install options - remove duplicate 'Recommended' label

* fix: change CPU-only install icon color to cyan

* fix: polish interactive installer output

* chore: register typescript eslint plugin
2026-02-04 20:28:48 -08:00
Ibi KellerandGitHub 4219e3e398 fix: Typo in gir1.2-ayatanaappindicator3-0.1 .deb package (Debian 13) (#101)
There was a typo in the gir1.2-ayatanaappindicator3-0.1 .deb package referred
to in apt commands, submitted in commit 27ebbfe417f178eaabcf2ac10af63f37bc819fac
gir1.2-ayatana-appindicator3 (typo) replaced with gir1.2-ayatanaappindicator3-0.1
per Debian package list at
https://packages.debian.org/search?keywords=gir1.2-ayatanaappindicator3-0.1
Will be backwards compatible with Debian 11 (bullseye), 12 (bookworm), and current
13 (trixie).

Changes:
- install.sh: gir1.2-ayatana-appindicator3 (typo) replaced with gir1.2-ayatanaappindicator3-0.1
- docs/INSTALL.md: gir1.2-ayatana-appindicator3 (typo) replaced with gir1.2-ayatanaappindicator3-0.1
- src/vocalinux/main.py: gir1.2-ayatana-appindicator3 (typo) replaced with gir1.2-ayatanaappindicator3-0.1
- CONTRIBUTING.md: gir1.2-ayatana-appindicator3 (typo) replaced with gir1.2-ayatanaappindicator3-0.1
2026-01-29 10:43:11 -08:00
jatinkrmalik 460378ae0c chore: bump version to v0.4.1-alpha
Release preparation for v0.4.1-alpha with the following updates:

Features:
- Language selector UI with 10 languages and auto-detection support

Bug Fixes:
- App drawer launch fix when installing from local repo (absolute path for VENV_DIR)
- Escape commit message in Detect Changes step
- Correct git fetch syntax for tag-based updates

Updated Files:
- src/vocalinux/version.py: 0.4.0-alpha → 0.4.1-alpha
- install.sh: Default tag v0.3.0-alpha → v0.4.1-alpha
- README.md: Install command version updates
- docs/INSTALL.md: Install command version updates
- docs/UPDATE.md: New v0.4.1-alpha section, moved v0.4.0-alpha to Previous Versions
- web/src/app/layout.tsx: Software version update
2026-01-29 00:13:34 -08:00
Jatin K MalikandGitHub 60f88a2c40 fix: ensure VENV_DIR is absolute path in local install (#96)
When installing from within the git repository, VENV_DIR remained as
the relative path "venv", which caused wrapper scripts in ~/.local/bin/
to fail when executed from any directory other than the repo root.

This broke launching from app drawers/desktop entries since they don't
set the working directory to the repo location.

Fix: Convert VENV_DIR to an absolute path ($INSTALL_DIR/$VENV_DIR) when
running from local repository, ensuring wrapper scripts work regardless
of current working directory.
2026-01-29 00:04:23 -08:00
ad84fd882a feat: add language selector UI with auto-detection support (#87)
* feat: add language selector UI with auto-detection support

This commit implements a comprehensive language selector for the GUI,
extending support from 4 to 10 languages and adding Whisper auto-detect.

Changes:
- Add SUPPORTED_LANGUAGES constant with 10 languages (auto, en-us, hi, es, fr, de, it, pt, ru, zh)
- Each language includes display name, Whisper code, VOSK model name, and optional warning
- Extend VOSK_MODEL_INFO to include Hindi, Spanish, Italian, Portuguese, and Chinese models
- Add language dropdown in Settings dialog with status indicators (✓ downloaded, ↓ needs download, ⚠ warning)
- Add language warning label for auto-detect and engine compatibility messages
- Update default language from "en-us" to "auto" for Whisper auto-detection
- Handle "auto" language in Whisper (passes None for auto-detect)
- Handle "auto" language in VOSK (falls back to "en-us" since VOSK doesn't support auto-detect)
- Update CLI --language argument to include all supported languages

Fixes the issue where Hindi speech was being transcribed as English
because the language was hardcoded to "en-us" which Whisper interpreted
as "force English transcription" rather than auto-detect.

Related PRs:
- #72 - Feature: Add language auto-detection and GUI selector (supersedes)
- #71 - Feature: Add multi-language support for FR, DE, RU (builds upon)
- #52 - Feature: 3 more languages for Whisper and VOSK (extends)
- #68 - Comment out language parameter in transcribe call (addresses)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: format main.py with black

* fix: use venv python and set GI_TYPELIB_PATH for verification

* fix: create wrapper scripts that set GI_TYPELIB_PATH

Problem: The symlinks in ~/.local/bin pointed to venv scripts that
failed because PyGObject couldn't find the system typelib files
(AppIndicator3 namespace not available).

Solution: Create wrapper scripts in ~/.local/bin that:
1. Set GI_TYPELIB_PATH=/usr/lib/girepository-1.0
2. Execute the venv's vocalinux scripts

This fixes the issue where vocalinux-gui would fail to start with:
ValueError: Namespace AppIndicator3 not available

* fix: set GI_TYPELIB_PATH in desktop entry Exec line

When launching from the app drawer, the environment variables from the
wrapper script weren't being inherited properly. By adding GI_TYPELIB_PATH
directly in the desktop entry's Exec line, the app can now find the
AppIndicator3 typelib files.

* fix: always create wrapper scripts, not just for remote installs

The wrapper scripts were only created when CLEANUP_ON_EXIT=yes, which
is only set for remote (curl-based) installations. When running from
a local repository, the wrapper scripts were never created, causing
the desktop entry and launch commands to fail.

* fix: prevent recursion in LoggingHandler when processing log records

The custom LoggingHandler was triggering logging from within the logging
system itself, causing infinite recursion when formatting log records.
This could happen when the logging formatter or any operation during
record processing triggered additional log messages.

Fix: Add _emitting flag to prevent recursive calls to emit().

* fix: prevent infinite loop in settings dialog when changing language

Add guard flags to prevent recursive event handler calls:
- _populating_models: blocks _on_model_changed during model population
- _processing_language_change: blocks recursive language change handling
- _applying_settings: blocks recursive settings application

These guards prevent the infinite loop that occurred when selecting a
language whose VOSK model wasn't downloaded yet.

Fixes issue where "Model small needs download" logged repeatedly.

* fix: handle language parameter in reconfigure and improve UX

- Fix reconfigure() to properly handle language parameter changes
- Remove _processing_language_change check from _auto_apply_settings
  to allow settings to be applied when language changes
- Hide unsupported languages in dropdown based on selected engine
  * VOSK: only show languages with available models (no "auto")
  * Whisper: show all supported languages including "auto"
- Remove duplicate _auto_apply_settings call in _on_engine_changed
- Set active language in combo after repopulating options

This fixes:
1. Whisper continuing to use old language after switching (e.g.,
   still transcribing in Hindi after switching to en-us)
2. Potential infinite loop when selecting languages for VOSK
3. User confusion by showing incompatible language options

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 23:16:06 -08:00
Jatin K MalikandGitHub d8cb0d325e fix: correct git fetch syntax for tag-based updates (#85) 2026-01-28 20:14:16 -08:00
68cb35f5b3 Fix: Handle deprecated appindicator package on Debian 13+ (#70)
* Fix: Handle deprecated appindicator package on Debian 13+

Fixes #69

The gir1.2-appindicator3-0.1 package was deprecated in Debian 13 (trixie)
and replaced with gir1.2-ayatana-appindicator3. This change adds fallback
logic to try the new package if the old one is not available.

Changes:
- install.sh: Try old package first, fall back to ayatana-appindicator
- docs/INSTALL.md: Document both package options
- src/vocalinux/main.py: Update error message with Debian 13+ note
- CONTRIBUTING.md: Update dev setup instructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: clean up whitespace in filtered package list

---------

Co-authored-by: Claude Opus <noreply@anthropic.com>
2026-01-28 19:56:52 -08:00
Jatin K MalikandGitHub 8a84b2c97f fix: remove --system-site-packages to avoid Python 3.12+ conflicts (#79)
Fixes #66

The --system-site-packages flag causes the virtual environment to inherit
system packages, which can include versions incompatible with newer Python
versions. On Arch/EndeavourOS with Python 3.12, an old coverage package
from the system causes Whisper to fail with:

    module 'coverage.types' has no attribute 'Tracer'

By creating an isolated virtual environment, all dependencies are installed
at compatible versions within the venv, avoiding such conflicts.
2026-01-28 19:54:11 -08:00
4d8f029c8f fix: Install script now uses release tag instead of main branch (#75)
Problem: Even though the website fetched install.sh from a specific release tag,
the script itself would clone the repository from main branch, installing
potentially unstable/untested code.

Solution:
- Add --tag parameter to install.sh to specify which release to install
- Default to v0.3.0-alpha (latest stable) instead of main
- Clone the specific tag using 'git clone --branch <tag>'
- Update website to pass --tag parameter with fetched release

Changes:
- install.sh: Add --tag parameter, default to v0.3.0-alpha, clone specific tag
- web/src/app/page.tsx: Pass --tag=<version> to install script

This ensures users install the exact release version they intended, not
whatever code is currently on main branch.

Co-authored-by: Claude Opus <noreply@anthropic.com>
2026-01-26 01:02:46 -08:00
Jatin K MalikandGitHub eec0182644 fix: persist model selection per-engine when switching between VOSK and Whisper (#64)
- Add vosk_model_size and whisper_model_size to config to track model
  selection independently for each engine
- Update config manager with get_model_size_for_engine() and
  set_model_size_for_engine() methods for per-engine model tracking
- Add automatic migration for existing configs without per-engine model sizes
- Update settings dialog to use engine-specific model sizes when populating
  model options
- Update install.sh to include new per-engine model fields in default config
- Fix: Previously, switching from VOSK to Whisper would incorrectly try to
  download the recommended model instead of the previously used model

Fixes the issue where switching back to Whisper after using VOSK would
start downloading the medium model instead of remembering the tiny model
that was configured during installation.
2026-01-20 19:35:16 -08:00
Jatin K MalikandGitHub 7a6d0d4e2b feat: flexible Whisper installation options for different system configurations (#63)
* fix: VOSK-only install and CLI arg handling for low-memory systems

Fixes several issues reported by users on low-memory systems (8GB RAM):

1. Install script: Don't auto-install Whisper in non-interactive mode
   - Previously, running 'curl | bash' would install Whisper by default
   - Now requires explicit --with-whisper flag to install Whisper
   - Prevents OOM errors on systems with limited RAM

2. CLI arguments: Command-line flags now properly override saved config
   - --engine vosk now works even if config file has whisper set
   - --model flag also properly overrides saved model setting
   - Checks sys.argv to detect if user explicitly provided arguments

3. Default engine: Changed from 'whisper' to 'vosk'
   - VOSK works on low-memory systems without OOM issues
   - Users can still install and use Whisper with --with-whisper flag
   - Existing configs with 'whisper' engine are still respected

Reported issues:
- OOM during installation on 8GB RAM system
- vocalinux --engine vosk being ignored
- Config file not respected when trying to force VOSK

* fix: keep whisper as default engine, improve test robustness

- Reverted default engine back to 'whisper' for better accuracy
- Install script still defaults to VOSK-only install (--with-whisper for Whisper)
- CLI args still properly override saved config
- Improved test_config_manager tests to handle module caching issues

* fix: default to Whisper install, --no-whisper for VOSK-only on low-RAM systems

Updated install behavior:
- Default (curl|bash): Installs Whisper for best experience
- --no-whisper flag: Skips Whisper AND creates config with VOSK as default engine

This allows low-RAM users (8GB) to run:
  curl -fsSL .../install.sh | bash -s -- --no-whisper

Which will:
1. Skip installing torch/whisper (avoids OOM)
2. Create ~/.config/vocalinux/config.json with engine='vosk'
3. App will use VOSK by default without needing CLI flags

* docs: clarify --no-whisper is for low-RAM systems (8GB or less)

Updated README and website to explain that --no-whisper flag:
- Is intended for systems with 8GB RAM or less
- Avoids out-of-memory errors during installation
- Configures VOSK as the default speech recognition engine

* feat: add --whisper-cpu flag for CPU-only PyTorch installation

New installation option for users without NVIDIA GPU or with limited RAM:

Install script changes:
- Added --whisper-cpu flag: Installs CPU-only PyTorch (~200MB vs ~2.3GB)
- Uses https://download.pytorch.org/whl/cpu index for smaller torch package
- Interactive mode now offers 3 options: GPU, CPU-only, or skip Whisper
- Updated help text to explain all Whisper installation options

Documentation updates:
- README: Added --whisper-cpu example with explanation
- Website: Added new 'Whisper CPU-only' install option section

Installation options summary:
- Default (curl|bash): Whisper + GPU/CUDA support (~2.3GB, 5-10 min)
- --whisper-cpu: Whisper + CPU-only PyTorch (~200MB, 3-4 min)
- --no-whisper: VOSK only, no Whisper (~2-3 min)
2026-01-20 19:19:09 -08:00
Jatin K MalikandGitHub f8e5de5621 feat: Make Whisper tiny the default engine and download during install (#45)
* feat: Make Whisper tiny the default engine and download during install

- Changed default engine from 'vosk' to 'whisper' in config_manager.py
- Changed default model_size from 'small' to 'tiny' in config_manager.py
- Added install_whisper_model() function to install.sh that downloads
  the Whisper tiny model (~75MB) during installation
- Whisper model is downloaded when Whisper package is installed
  (in non-interactive mode or with --with-whisper flag)
- Updated installation summary to show Whisper model status
- Updated documentation (README.md, INSTALL.md, SECURITY.md, USER_GUIDE.md)
  to reflect Whisper tiny as the default engine

This provides a better out-of-box experience: users can install and
immediately use Vocalinux without any additional downloads or prompts.

* test: Update test to reflect whisper as default engine
2025-12-28 20:31:29 -08:00
Jatin K MalikandGitHub 8b9dcb2586 fix: Install/uninstall scripts for curl | bash usage (#41)
* fix: install/uninstall scripts for curl | bash usage

Install script improvements:
- Detect non-interactive mode (curl | bash) automatically
- Skip interactive prompts in non-interactive mode
- Add --no-whisper and -y/--yes flags for explicit control
- Continue with defaults when stdin is not a tty

Uninstall script improvements:
- Clean up curl-installed files:
  - ~/.local/share/vocalinux-install (cloned repo)
  - ~/.local/share/vocalinux/venv (virtual environment)
  - ~/.local/bin/vocalinux (symlink)
  - ~/.local/bin/activate-vocalinux.sh
- Add -y/--yes flag for non-interactive mode
- Verify all curl-installed components are removed

README updates:
- Document curl installation with --with-whisper option
- Add uninstall instructions for both methods
- Clarify what gets installed where

* feat: install Whisper by default in non-interactive mode

- curl | bash now installs both VOSK and Whisper out of the box
- Users can freely switch between engines in settings
- Add --no-whisper flag for faster install (VOSK only)
- Update README to reflect new default behavior

* chore: remove install-whisper.sh (now part of install.sh)

Whisper is installed by default via install.sh, making this
separate script redundant.

* chore: remove activate-vocalinux.sh (generated by install.sh)

This file is dynamically created by install.sh based on the
venv location, so the static template is not needed.
2025-12-28 16:04:59 -08:00
Jatin K MalikandGitHub 652499a18d fix: install.sh now works with curl | bash (#40)
- Auto-clones repo when run remotely (via curl | bash)
- Installs venv to ~/.local/share/vocalinux/venv
- Creates symlink at ~/.local/bin/vocalinux
- Creates activation script at ~/.local/bin/activate-vocalinux.sh
- Updates README with new installation instructions

Fixes installation for users running:
curl -fsSL https://raw.githubusercontent.com/.../install.sh | bash
2025-12-28 15:43:15 -08:00
Jatin K MalikandGitHub 917510d3f4 feat: Enhance Whisper Support & Improve Settings UI (#38)
* feat: Implement comprehensive Whisper speech recognition support

🎯 Complete Whisper Implementation:
- Proper model size validation and mapping (small->base, medium->small, large->medium)
- GPU/CPU device detection and automatic model placement
- Efficient in-memory audio processing (no temporary files)
- Custom model cache directory for organized storage
- Enhanced error handling with detailed logging
- Optimized transcription parameters for better accuracy

🔧 Technical Improvements:
- Replace temporary file approach with direct tensor processing
- Add torch.no_grad() context for efficient inference
- Implement proper audio normalization and padding
- Add comprehensive error handling and recovery
- Support for both CPU and CUDA acceleration

📦 Installation Integration:
- Add --with-whisper flag to installation script
- Update setup.py with correct openai-whisper dependencies
- Include torch and torchaudio in whisper extras
- Automatic and manual installation options

🧪 Testing & Validation:
- Add comprehensive test suite for Whisper functionality
- Test model size mapping, initialization, and transcription
- Mock-based testing for environments without Whisper installed
- Integration with existing test infrastructure

💡 Performance Optimizations:
- Efficient audio buffer processing without file I/O
- GPU acceleration when available
- Optimized Whisper parameters for real-time usage
- Memory-efficient model loading and caching

🔄 Backward Compatibility:
- Maintains full compatibility with existing VOSK implementation
- Graceful fallback when Whisper dependencies are missing
- No breaking changes to existing API

This implementation provides a production-ready Whisper integration
that significantly improves transcription accuracy while maintaining
the performance characteristics needed for real-time voice dictation.

* feat: Add comprehensive Whisper installation support and error handling

🎯 Enhanced User Experience:
- Add intelligent Whisper import error detection in settings dialog
- Show helpful installation instructions when Whisper is missing
- Automatically revert to VOSK when Whisper selection fails
- Provide multiple installation methods and troubleshooting tips

📋 New Installation Helper:
- Create install-whisper.sh script for dedicated Whisper installation
- Support multiple installation methods (standard, trusted hosts, break-system-packages)
- Comprehensive error handling and fallback options
- Clear instructions for SSL issues and alternative approaches

🔧 Improved Error Handling:
- Detect Whisper import errors specifically in settings dialog
- Show user-friendly dialog with installation instructions
- Graceful fallback to VOSK when Whisper unavailable
- Detailed logging for troubleshooting

💡 User Guidance:
- Step-by-step installation instructions in error dialog
- Multiple installation options for different environments
- Clear explanation of disk space and time requirements
- Troubleshooting tips for common SSL issues

🛠️ Technical Features:
- Automatic virtual environment detection
- Installation verification and model listing
- SSL issue detection and workarounds
- Comprehensive error reporting and recovery

This addresses the immediate issue where users get cryptic errors
when trying to use Whisper without proper installation, providing
clear guidance and multiple solutions for different scenarios.

* feat: Enhance Whisper support and improve Settings UI

## Whisper Implementation Fixes
- Fix Whisper transcription by removing unnecessary audio padding
- Fix API usage: pass numpy array directly instead of torch tensor
- Remove confusing model size remapping (users select exact model names)
- Add fp16=False for CPU to prevent warnings
- Fix missing 'import torch' in install-whisper.sh verification

## Audio System Improvements
- Add ALSA error handler to suppress noisy warnings
- Process remaining audio buffer when stopping recognition (fixes test button)

## Settings Dialog UI Enhancements
- Add model metadata display (download status, size, recommendations)
- Show ✓ for downloaded models, ↓ for pending downloads, ★ for recommended
- Add system-based model recommendations (based on RAM/GPU)
- Implement auto-apply settings on change (remove Apply button)
- Fix VOSK settings visibility when Whisper is selected
- Add VOSK model info panel with same features as Whisper
- Fix test recognition to show results in dialog instead of injecting text
- Fix race condition in test result display

## Startup Improvements
- Load saved config on startup (engine/model now persists correctly)
- Settings are remembered between app restarts

## Code Quality
- Add get_text_callbacks/set_text_callbacks methods for test isolation
- Update tests with proper mocking
2025-12-28 13:06:51 -08:00
Jatin K MalikandGitHub 98cba5f549 feat: Package VOSK model with installation for faster first-run experience (#32)
* feat: Package VOSK model with installation for faster first-run experience

🚀 Installation Improvements:
- Add VOSK small model download during installation process
- Eliminate first-run model download delay for better user experience
- Add --skip-models option for offline installations
- Include wget, curl, unzip in system dependencies for model download

🔍 Model Management Enhancements:
- Add multi-location model search (user, system-wide, pre-installed)
- Prioritize pre-installed models over downloads
- Add informative logging for model source detection
- Create marker files to identify installer-provided models

📦 Installation Script Features:
- Robust model download with progress indicators
- Internet connectivity checking before download attempts
- Graceful fallback when download fails (runtime download)
- Comprehensive error handling and cleanup
- Installation summary includes model status

🔧 Recognition Manager Updates:
- Check multiple model locations in priority order:
  1. User's local models directory
  2. System-wide installation directories
  3. Download to user directory if not found
- Enhanced logging for model source identification
- Backward compatibility with existing installations

💡 Benefits:
- Faster application startup (no initial model download)
- Better offline installation support
- Reduced first-run friction for users
- Maintains fallback to runtime download if needed
- Clear feedback about model installation status

This addresses the issue where users had to wait for model downloads
on first application launch, making VocaLinux ready to use immediately
after installation.

* fix: Move install_vosk_models function definition before its call

The function was being called before it was defined, causing a
'command not found' error during installation. Fixed by moving
the function definition to before the installation steps where
it's called.

This resolves the installation error:
./install.sh: line 701: install_vosk_models: command not found
2025-06-23 18:05:29 -05:00
Jatin K MalikandGitHub 7a283169b8 Improve installation scripts with better platform detection, dependency management, and error handling (#29) 2025-06-23 15:02:51 -05:00
Jatin K MalikandGitHub b5af600714 Custom Icons Implementation and Package Restructuring (#21)
* Implement custom icon for Vocalinux (Closes #10)

* Fix system tray icon display issue

* Temp commit before purging

* refactor: restructure project into proper vocalinux package

* test: fix and improve audio_feedback and tray_indicator tests with proper mocking and isolation

* test: update import paths in test files to use the new package structure

* Remove icon background

* fix: implement robust resource path discovery in audio_feedback module

* fix: improve resource discovery across application for consistent icon and sound loading

* chore: ensure uninstall script is compatible with new resource paths

* Fix black formatting
2025-04-19 20:54:34 -05:00
Jatin K MalikandGitHub a28f55b72e Add pre-commit hooks to match GitHub CI pipeline (#7)
* Add pre-commit hooks to match CI pipeline linting rules

* Add pre-commit hooks that match GitHub CI pipeline exactly

* Ran lint check
2025-04-17 00:05:34 -05:00
jatinkrmalik ee227252f2 Refactor project name from 'Ubuntu Voice Typing' to 'Vocalinux'\n\nThis commit updates all references to the project name across the codebase, documentation, and metadata. The changes include:\n- Updating module docstrings, comments, and logging messages.\n- Renaming files and directories where necessary.\n- Updating references in README, INSTALL, and LICENSE files.\n- Adjusting paths and identifiers in the code to reflect the new name.\n\nThis refactor ensures consistency and prepares the project for its new branding as 'Vocalinux'.\n\nPlease review the changes carefully to ensure no functionality is affected. 2025-04-12 00:53:48 -05:00
jatinkrmalik 7ed83c36a5 Add fallback text injection for Wayland and improve installation script 2025-04-07 17:44:19 -05:00
jatinkrmalik 280158aea0 Add desktop entry and installation script 2025-04-07 17:06:13 -05:00