No description
Find a file
2026-02-18 13:02:16 -03:00
src update prompt 2026-02-18 13:02:16 -03:00
systemd Update project files 2026-02-10 11:01:36 -03:00
.gitignore Update project files 2026-02-10 11:01:36 -03:00
AGENTS.md Migrate to Python daemon 2026-02-07 15:12:17 -03:00
Makefile Update project files 2026-02-10 11:01:36 -03:00
pyproject.toml Update project files 2026-02-10 11:01:36 -03:00
README.md Use base URL for chat completions 2026-02-10 11:00:52 -03:00
uv.lock Update project files 2026-02-10 11:01:36 -03:00

lel

Python X11 transcription daemon that records audio, runs Whisper, logs the transcript, and can optionally run AI post-processing before injecting text.

Requirements

  • X11 (not Wayland)
  • ffmpeg
  • faster-whisper
  • pactl (PulseAudio utilities for mic selection)
  • Tray icon deps: gtk3
  • i3 window manager (focus metadata via i3 IPC)
  • Python deps: pillow, python-xlib, faster-whisper, PyGObject, i3ipc

Python Daemon

Install Python deps:

uv sync

Run:

uv run python3 src/leld.py --config ~/.config/lel/config.json

Open settings:

uv run python3 src/leld.py --settings --config ~/.config/lel/config.json

Config

Create ~/.config/lel/config.json:

{
  "daemon": { "hotkey": "Cmd+m" },
  "recording": { "input": "pulse:default" },
  "transcribing": { "model": "base", "device": "cpu" },
  "injection": { "backend": "clipboard" },

  "ai_cleanup": {
    "enabled": true,
    "model": "llama3.2:3b",
    "temperature": 0.0,
    "base_url": "http://localhost:11434",
    "api_key": ""
  }
}

Env overrides:

  • WHISPER_MODEL, WHISPER_DEVICE
  • WHISPER_FFMPEG_IN
  • LEL_HOTKEY, LEL_INJECTION_BACKEND
  • LEL_AI_CLEANUP_ENABLED, LEL_AI_CLEANUP_MODEL, LEL_AI_CLEANUP_TEMPERATURE
  • LEL_AI_CLEANUP_BASE_URL, LEL_AI_CLEANUP_API_KEY

systemd user service

mkdir -p ~/.local/bin
cp src/leld.py ~/.local/bin/leld.py
cp systemd/lel.service ~/.config/systemd/user/lel.service
systemctl --user daemon-reload
systemctl --user enable --now lel

Usage

  • Press the hotkey once to start recording.
  • Press it again to stop and transcribe.
  • The transcript is logged to stderr.

Injection backends:

  • clipboard: copy to clipboard and inject via Ctrl+Shift+V (GTK clipboard + XTest)
  • injection: type the text with simulated keypresses (XTest)

AI provider:

  • Generic OpenAI-compatible chat API at ai_base_url (base URL only; the app uses /v1/chat/completions)

Context capture (i3 only):

  • The focused window at hotkey time is stored via i3 IPC.
  • If focus changes before injection, the workflow aborts (interpreted as a cancel).

Control:

make run