Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 99 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@
</div>
</div>

# 🚀 Quick Start

```bash
# 1. Install system dependencies (Ubuntu/Debian)
sudo apt install -y portaudio19-dev libmpv-dev cmake

# 2. Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# 3. Clone and install
git clone https://github.com/omegaui/linux-voice-control
cd linux-voice-control
uv sync

# 4. Run
uv run lvc
```

# ![](https://img.icons8.com/color/48/null/metallic-paint.png) Features
- [x] [**ChatGPT Mode**](https://github.com/omegaui/linux-voice-control/issues/8) (just say **activate chat mode**)
- [x] GUI Mode (using Flutter)
Expand Down Expand Up @@ -67,7 +85,7 @@ Let's just see how to set up master control mode:
After installing,
run the **master_control_mode_setup.py** script
```shell
python3 master_control_mode_setup.py
uv run python lvc/master_control_mode_setup.py
```

You will be asked to speak three times given only 3 seconds each time.
Expand All @@ -85,14 +103,49 @@ Even you can just say **activate master control mode** during the runtime to ena

# ![](https://img.icons8.com/external-icongeek26-flat-icongeek26/32/000000/external-Sage-Leaves-recipes-and-ingredients-icongeek26-flat-icongeek26.png) Usage / Install

Lets quick finish the setup
## Prerequisites

Before installing, make sure you have:
- Python 3.11 or higher
- [uv](https://github.com/astral-sh/uv) - Fast Python package manager
- Required system dependencies:
```bash
# For Ubuntu/Debian:
sudo apt update
sudo apt install -y portaudio19-dev

# For Fedora:
sudo dnf install -y portaudio-devel
```
- Optional system dependencies (for full functionality):
```bash
# For Ubuntu/Debian:
sudo apt install -y libmpv-dev cmake

# For Fedora:
sudo dnf install -y mpv-devel cmake
```

**Note**: The application will run without optional dependencies, but some features will be limited:
- Without `libmpv-dev`: Voice feedback will print to console instead of playing audio
- Without `cmake`: Master mode voice verification (speechbrain) will be disabled

## Quick Install

```shell
# Clone the repository
git clone https://github.com/omegaui/linux-voice-control
cd linux-voice-control
./install.sh
```

The `install.sh` script will set up your installation of linux-voice-control by installing some dependencies with pip.
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install all dependencies
uv sync

# Run the setup script
uv run python lvc/master_control_mode_setup.py # Optional: For master control mode
```

The above process will finish off writing `lvc-config.json` and `lvc-commands.json` file to your root (~) and also the sources to `~/lvc-bin`.
That's how your `lvc-config.json` look initially ...
Expand Down Expand Up @@ -187,21 +240,56 @@ After getting the audio transcription, a fuzzy match is applied against the keys

Just like you search something on Google and getting the correct results even after typing the wrong spelling.

Your installation is all set for usage (for forking too 😉).
Just hit `linux-voice-control` in the terminal.
## Running Linux Voice Control

**Life Saver Tip: _Add `linux-voice-control-gui` to your startup scripts_**
```bash
# Run the CLI version
uv run lvc

# Or run directly with Python
uv run python -m lvc.main

# Run the GUI version (if available)
uv run lvc-gui
```

**Life Saver Tip: _Add `uv run lvc-gui` to your startup scripts_**

**Future Ideas**: Adding Dynamic Voice Control like _hey alex ... call Spider-Man_ (you already know things like that) and most important things [discussions](https://github.com/omegaui/linux-voice-control/discussions)

# ![](https://img.icons8.com/fluency/32/000000/sourcetree.png) Build from source

Super simple things you know ...
## Development Setup

```shell
# Clone the repository
git clone https://github.com/omegaui/linux-voice-control
cd linux-voice-control
pip install -r requirements.txt
python3 main.py

# Install with development dependencies
uv sync --dev

# Run development tasks
uv run poe check # Run linting checks
uv run poe format # Format code
uv run poe typecheck # Run type checking
uv run poe test # Run tests

# Run the application
uv run python -m lvc.main
```

## Package Management

```bash
# Add a new dependency
uv add package-name

# Add a development dependency
uv add --dev package-name

# Update dependencies
uv sync --upgrade
```

If you are unable to build pyaudio,
Expand Down
204 changes: 158 additions & 46 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,161 @@
#!/bin/sh

echo "pip installing requirements.txt ..."
pip install -r requirements.txt
pip install playwright
playwright install
echo "You need to login into ChatGPT to use chat mode, to do so run <chatgpt install>."
echo "Settings up Linux-Voice-Control (lvc) ..."
mkdir ~/lvc-bin
mkdir ~/lvc-bin/misc
mkdir ~/lvc-bin/gui
echo "Copying sources and icon to ~/lvc-bin ..."
cp main.py ~/lvc-bin
cp command_manager.py ~/lvc-bin
cp config_manager.py ~/lvc-bin
cp __init__.py ~/lvc-bin
cp notifier.py ~/lvc-bin
cp voice_feedback.py ~/lvc-bin
cp utils.py ~/lvc-bin
cp chatgpt_port.py ~/lvc-bin
cp basic_mode_manager.py ~/lvc-bin
cp live_mode_manager.py ~/lvc-bin
cp live_mode_setup.py ~/lvc-bin
cp master_mode_manager.py ~/lvc-bin
cp master_control_mode_setup.py ~/lvc-bin
cp images/lvc-icon.png ~/lvc-bin
cp misc/greeting.mp3 ~/lvc-bin/misc
cp misc/internal-voice-feedback-error.mp3 ~/lvc-bin/misc
cp misc/network-error.mp3 ~/lvc-bin/misc
cp misc/exiting-feedback.mp3 ~/lvc-bin/misc
cp -r gui/* ~/lvc-bin/gui
echo "Copying all launchers to /usr/bin (requires root access) ..."
sudo cp linux-voice-control /usr/bin
sudo cp linux-voice-control-gui /usr/bin
sudo chmod 0755 /usr/bin/linux-voice-control /usr/bin/linux-voice-control-gui ~/lvc-bin/gui/lvc_gui_flutter
echo "Copying default commands and config to ~ ..."
cp lvc-commands.json ~/lvc-bin
cp lvc-config.json ~/lvc-bin
echo "All Set"
echo "That's how your lvc-config.json looks right now ..."
cat ~/lvc-bin/lvc-config.json
echo
echo "And these are some raw commands ..."
cat ~/lvc-bin/lvc-commands.json
echo
echo "Attach linux-voice-control-gui script to your startup for an always ready assist."
echo
echo "Execute linux-voice-control or linux-voice-control-gui now to start it here!"
echo "====================================="
echo "Linux Voice Control (LVC) Installer"
echo "====================================="
echo

# Check if uv is installed
UV_CMD=""
if command -v uv &> /dev/null; then
UV_CMD="uv"
elif [ -x "$HOME/.local/bin/uv" ]; then
UV_CMD="$HOME/.local/bin/uv"
elif [ -x "$HOME/.cargo/bin/uv" ]; then
UV_CMD="$HOME/.cargo/bin/uv"
else
echo "Error: uv is not installed. Please install it first:"
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
exit 1
fi

echo "Found uv at: $UV_CMD"

# Check for system dependencies
echo "Checking system dependencies..."
missing_deps=""

if ! command -v cmake &> /dev/null; then
missing_deps="$missing_deps cmake"
fi

if ! pkg-config --exists portaudio-2.0 2>/dev/null; then
missing_deps="$missing_deps portaudio19-dev"
fi

if ! pkg-config --exists mpv 2>/dev/null; then
missing_deps="$missing_deps libmpv-dev"
fi

if [ -n "$missing_deps" ]; then
echo "Error: Missing system dependencies:$missing_deps"
echo
echo "Please install them first:"
echo " Ubuntu/Debian: sudo apt install -y$missing_deps"
echo " Fedora: sudo dnf install -y portaudio-devel mpv-devel cmake"
exit 1
fi

echo "System dependencies OK ✓"
echo

# Install Python dependencies
echo "Installing Python dependencies with uv..."
$UV_CMD sync

if [ $? -ne 0 ]; then
echo "Error: Failed to install dependencies. Please check the error messages above."
exit 1
fi

echo "Python dependencies installed ✓"
echo

# Create directories
echo "Setting up Linux-Voice-Control (lvc) directories..."
mkdir -p ~/lvc-bin/misc
mkdir -p ~/lvc-bin/gui

# Copy configuration files
echo "Copying configuration files..."
cp -n lvc-commands.json ~/lvc-bin/lvc-commands.json 2>/dev/null || echo "Config files already exist, skipping..."
cp -n lvc-config.json ~/lvc-bin/lvc-config.json 2>/dev/null || echo "Config files already exist, skipping..."

# Copy resources
echo "Copying resources..."
cp images/lvc-icon.png ~/lvc-bin/ 2>/dev/null || true
cp -r misc/* ~/lvc-bin/misc/ 2>/dev/null || true
cp -r gui/* ~/lvc-bin/gui/ 2>/dev/null || true

# Create launcher scripts
echo "Creating launcher scripts..."

# Create main launcher
cat > linux-voice-control << EOF
#!/bin/bash
# Find uv command
if command -v uv &> /dev/null; then
UV_CMD="uv"
elif [ -x "\$HOME/.local/bin/uv" ]; then
UV_CMD="\$HOME/.local/bin/uv"
elif [ -x "\$HOME/.cargo/bin/uv" ]; then
UV_CMD="\$HOME/.cargo/bin/uv"
else
echo "Error: uv not found. Please install it first."
exit 1
fi

cd "\$(dirname "\$0")"
exec \$UV_CMD run lvc "\$@"
EOF

# Create GUI launcher
cat > linux-voice-control-gui << EOF
#!/bin/bash
# Find uv command
if command -v uv &> /dev/null; then
UV_CMD="uv"
elif [ -x "\$HOME/.local/bin/uv" ]; then
UV_CMD="\$HOME/.local/bin/uv"
elif [ -x "\$HOME/.cargo/bin/uv" ]; then
UV_CMD="\$HOME/.cargo/bin/uv"
else
echo "Error: uv not found. Please install it first."
exit 1
fi

cd "\$(dirname "\$0")"
exec \$UV_CMD run lvc-gui "\$@"
EOF

chmod +x linux-voice-control linux-voice-control-gui

# Install launchers
if [ -t 0 ]; then
# Terminal is available, try sudo
echo "Installing launchers (requires root access)..."
if sudo cp linux-voice-control /usr/local/bin/ 2>/dev/null && \
sudo cp linux-voice-control-gui /usr/local/bin/ 2>/dev/null && \
sudo chmod 0755 /usr/local/bin/linux-voice-control /usr/local/bin/linux-voice-control-gui 2>/dev/null; then
echo "Launchers installed to /usr/local/bin/ ✓"
else
echo "Note: Could not install launchers to /usr/local/bin/ (sudo required)"
echo "You can run the launchers from the current directory instead"
fi
else
echo "Note: Skipping system-wide launcher installation (no terminal available)"
echo "You can run './linux-voice-control' from this directory"
fi

echo
echo "====================================="
echo "Installation Complete! ✓"
echo "====================================="
echo
echo "Configuration files location: ~/lvc-bin/"
echo
echo "Usage:"
echo " - Run CLI version: linux-voice-control"
echo " - Run GUI version: linux-voice-control-gui"
echo " - Run directly: uv run lvc"
echo
echo "Development commands:"
echo " - Run checks: uv run poe check"
echo " - Format code: uv run poe format"
echo " - Run tests: uv run poe test"
echo
echo "To set up master control mode:"
echo " uv run python lvc/master_control_mode_setup.py"
echo
echo "Tip: Add linux-voice-control-gui to your startup scripts for always-ready assistance!"
echo
15 changes: 13 additions & 2 deletions linux-voice-control
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/bash
# Find uv command
if command -v uv &> /dev/null; then
UV_CMD="uv"
elif [ -x "$HOME/.local/bin/uv" ]; then
UV_CMD="$HOME/.local/bin/uv"
elif [ -x "$HOME/.cargo/bin/uv" ]; then
UV_CMD="$HOME/.cargo/bin/uv"
else
echo "Error: uv not found. Please install it first."
exit 1
fi

cd ~/lvc-bin || exit
python3 main.py "$@"
cd "$(dirname "$0")"
exec $UV_CMD run lvc "$@"
15 changes: 13 additions & 2 deletions linux-voice-control-gui
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/bash
# Find uv command
if command -v uv &> /dev/null; then
UV_CMD="uv"
elif [ -x "$HOME/.local/bin/uv" ]; then
UV_CMD="$HOME/.local/bin/uv"
elif [ -x "$HOME/.cargo/bin/uv" ]; then
UV_CMD="$HOME/.cargo/bin/uv"
else
echo "Error: uv not found. Please install it first."
exit 1
fi

cd ~/lvc-bin/gui || exit
./lvc_gui_flutter
cd "$(dirname "$0")"
exec $UV_CMD run lvc-gui "$@"
Loading