Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tony Stark Setup

An always-on Arch Linux voice and clap trigger that launches your desktop tools after login.

What it does

After you boot your laptop and log into your desktop session, a background listener waits for either of these independent triggers:

  • two claps
  • the exact phrase Wake up, daddy's home

When either trigger matches, it launches:

  • Brave with a configured URL
  • ghostty
  • VS Code

This project uses a native Linux microphone listener. Brave is only launched as an action target and does not need microphone permission.

How it works

  • listener.py captures microphone audio with ffmpeg through PipeWire/Pulse.
  • Clap detection runs on raw PCM frames using peak and RMS thresholds plus a short double-clap timing window.
  • Phrase detection uses Vosk with an offline English speech model.
  • A systemd --user service keeps the listener running after login.
  • When a trigger fires, the listener launches the configured desktop commands and enforces cooldowns to avoid spam.

Project files

Requirements

  • Arch Linux or another Linux desktop with PipeWire/Pulse support
  • ffmpeg
  • Python 3
  • a working microphone
  • a Vosk English model

Installation

  1. Clone the repo:
git clone https://github.com/dasturchioka/tony-stark-setup.git
cd tony-stark-setup
  1. Create a virtual environment and install Python dependencies:
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
  1. Download and extract the small English Vosk model:
mkdir -p model
cd model
curl -LO https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip
unzip -o vosk-model-small-en-us-0.15.zip
cd ..
  1. Adjust config.json if needed.

  2. Install the user service:

mkdir -p ~/.config/systemd/user
cp systemd/wake-home-listener.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now wake-home-listener.service

Configuration

Default config values:

  • phrase: Wake up, daddy's home
  • URL: https://youtu.be/KPeT0jTcWGU
  • commands: Brave, Ghostty, VS Code
  • clap timing window: 900 ms
  • clap cooldown: 12000 ms
  • phrase cooldown: 12000 ms
  • global action cooldown: 15000 ms

You can change the trigger phrase, target URL, launch commands, device name, and clap thresholds in config.json.

Manual testing

Run the listener directly before enabling the service:

.venv/bin/python listener.py

Then test:

  • clap twice
  • say Wake up, daddy's home

Check listener.log to see recognized phrases and trigger events.

Tuning

  • Raise clap_peak_threshold if claps trigger too easily.
  • Raise clap_rms_threshold if background noise causes false positives.
  • Raise clap_window_ms if your double clap is slower.
  • Change device if default is not the microphone source you want.

Limitations

  • Clap and speech recognition are not mathematically 100% certain.
  • Vosk phrase recognition quality depends on microphone quality, background noise, and pronunciation.
  • The service starts after login, not before login.

License

MIT

About

Clap 2 times or say "Wake up, daddy's home", and it opens Brave, Ghostty and Visual Studio Code

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages