Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎙️ Voice-Driven Linux Workflow Automation

OS: Arch Linux WM: Hyprland Language: Python Status Bar: Waybar UI: AGS GTK

A highly optimized, visually stunning, and hands-free custom desktop environment built on Arch Linux and the Hyprland window manager. This project combines a modern Catppuccin-themed layout with a robust background voice automation engine, system maintenance daemons, and local AI (Ollama) synthesis.


🧭 System Architecture & Flow

The system coordinates speech processing, desktop events, and graphical indicators asynchronously:

graph TD
    User([🎙️ User Speech]) -->|Super + V / Wake Word| Mic[ALSA / PulseAudio Microphone]
    Mic -->|Audio Buffer| VA[Voice Assistant Engine]
    VA -->|STT: Google / Sphinx API| Parse{Command Router}
    
    Parse -->|Ollama Query| Ollama[Local Ollama: Llama3]
    Ollama -->|AI Text Output| TTS[Text-to-Speech: pyttsx3 / Espeak]
    
    Parse -->|System Match| Cmd[Shell Command Executor]
    Cmd -->|hyprctl dispatch| Hyprland[Hyprland Window Manager]
    Cmd -->|Waybar Toggle| Waybar[Waybar Panels]
    Cmd -->|System Script| Maintenance[Maintenance Agent]
    
    VA -->|Audio Feedback / Alert| Sounds[System Audio Cues]
    VA -->|Status / Log Output| Notification[notify-send Desktop Notifications]
    
    Daemon[Systemd User Daemon] -->|Manages Background| VA
    AGS[AGS Control Center] -->|Polls Status / Trigger| Daemon
Loading

✨ Features

  • Instant Voice Orchestration: Perform window navigation, system adjustments, and menu actions hands-free.
  • Local LLM Integration (Ollama): Route questions to local models via voice commands ("ask ai...") and receive spoken responses.
  • Zero-Dependency Virtual Env Setup: Full Python package isolation to ensure clean system installations (PEP 668 compliant).
  • AGS Control Center Panel: A GTK-based Control Center with a voice automation monitor, real-time daemon status indicator, and manual trigger button.
  • Dynamic Waybar Toggle: Switch seamlessly between horizontal and vertical status bars.
  • Automated Housekeeping Timers: Daily systemd timer that runs cache cleaning, package cache prunes (via paccache), and log prunes, displaying visual notifications of space freed.
  • Premium Theme & Aesthetics: Cohesive dark aesthetic styled around Catppuccin Mocha colors.

🛠️ Complete Installation Guide

📋 Prerequisites

To deploy this environment, you must be running Arch Linux with a working audio setup (PipeWire, PulseAudio, or ALSA).

Ensure git and sudo are installed before running:

sudo pacman -S --needed git

🚀 Step-by-Step Setup

Follow these commands to deploy the environment on a fresh Arch Linux system:

# 1. Clone the repository
git clone https://github.com/wasifshaffaq/voice-driven-linux.git
cd voice-driven-linux

# 2. Make the installer executable
chmod +x install.sh

# 3. Run the master deployment script
./install.sh

🔍 What install.sh Does Under the Hood

  1. Core Packages: Installs Hyprland, Waybar, Rofi (Wayland), Kitty, GNU Stow, system audio utilities, and nerd fonts.
  2. Audio/STT Support: Installs portaudio (for python-pyaudio), espeak-ng (for offline TTS), pacman-contrib (for paccache), and alsa-utils.
  3. AUR Helpers: Checks for and installs paru if not found.
  4. AUR Packages: Deploys aylurs-gtk-shell (AGS), swww (wallpaper manager), libinput-gestures, and auto-cpufreq.
  5. Config Symlinking: Uses stow to securely symlink configuration folders into your home directory (~/.config/).
  6. Python Sandbox Environment: Creates a virtual environment in ~/.config/voice-assistant/venv/ and installs pip dependencies (SpeechRecognition, pyaudio, pyttsx3, requests).
  7. Systemd Services: Loads and enables the background voice daemon (voice-assistant.service) and the daily maintenance timers (system-maintenance.timer).

🎙️ Voice Assistant Guide

🎮 How to Trigger the Assistant

The voice assistant can be triggered in three ways:

  1. Hotkey (On-Demand Mode): Press SUPER + V (Windows key + V) on your keyboard. The system will play an audio cue and listen for a single command.
  2. Wake Word (Daemon Mode): Say "computer" close to your microphone. The assistant will wake up and listen for your instruction.
  3. Control Center Button: Open the Control Center with SUPER + C and click the Speak Command button.

📋 Out-of-the-Box Voice Commands

All speech commands are mapped dynamically in commands.json.

Target Action Voice Prompt Examples Executed Command
Launch Terminal "open terminal", "launch terminal" hyprctl dispatch exec kitty
Close Window "close window", "kill active" hyprctl dispatch killactive
Open Menu "open menu", "launch menu" rofi -show drun
Toggle Status Bar "toggle waybar", "toggle bar" ~/.config/waybar/scripts/toggle_waybar.sh
Increase Volume "volume up", "increase volume" wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
Decrease Volume "volume down", "decrease volume" wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
Mute Volume "mute audio", "toggle mute" wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
AI LLM Query "ask ai [your question]" Route to local Ollama API (llama3) & speaks response
Run Maintenance "system clean", "run cleanup" Executes local disk space/log vacuum maintenance
System Update "system update", "update packages" Launches package manager upgrade in terminal

⚙️ Customization & Extensibility

📝 Editing Voice Commands

Add your own voice triggers and system shell actions by editing the JSON mapping file:

nano ~/.config/voice-assistant/commands.json

Example command entry:

{
  "pattern": "^open browser|launch firefox$",
  "command": "hyprctl dispatch exec firefox",
  "response": "Launching Web Browser"
}

🧰 Troubleshooting & Testing

🧪 Run Local Logic Validation

Verify command parsing and matching rules using the built-in test runner:

python test_voice_assistant.py

📋 View Daemon Logs

If the voice assistant background daemon is not responding, inspect the systemd user service logs:

systemctl --user status voice-assistant.service
journalctl --user -u voice-assistant.service -n 50 -f

🔊 Audio Configuration Checklist

  • Ensure your microphone is active and not hardware-muted: alsamixer
  • Check default audio inputs using wireplumber: wpctl status

📂 Codebase Layout

├── dotfiles
│   └── .config
│       ├── ags                    # Aylurs GTK Shell configs (Control Center)
│       ├── hypr                   # Hyprland Window Manager configurations
│       ├── rofi                   # Application Menu styling
│       ├── systemd                # User Systemd Services & Timers
│       ├── voice-assistant        # Voice engine (Python, Commands configuration)
│       └── waybar                 # Status bar layouts (vertical and horizontal)
├── install.sh                     # System deployment and setup orchestrator
├── test_voice_assistant.py        # Python unit tests for the command logic
└── README.md                      # Documentation

📄 License

This project is open-source and available under the MIT License.

About

Voice-driven workflow automation on Arch Linux & Hyprland. Features offline STT/TTS commands, local Ollama AI voice control, custom systemd daemons, and daily automated system maintenance.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.