1.9 KiB
1.9 KiB
Repository Guidelines
Project Structure & Module Organization
src/leld.pyis the primary entrypoint (X11 STT daemon).src/recorder.pyhandles audio capture using PortAudio viasounddevice.src/leld.pyowns Whisper setup and transcription.src/aiprocess.pyruns the in-process Llama-3.2-3B cleanup.src/desktop_x11.pyencapsulates X11 hotkeys, tray, and injection.src/desktop_wayland.pyscaffolds Wayland support (exits with a message).
Build, Test, and Development Commands
- Install deps (X11):
uv sync --extra x11. - Install deps (Wayland scaffold):
uv sync --extra wayland. - Run daemon:
uv run python3 src/leld.py --config ~/.config/lel/config.json.
System packages (example names):
- Core:
portaudio/libportaudio2. - X11 tray:
libayatana-appindicator3.
Coding Style & Naming Conventions
- Shell scripts use Bash with
set -euo pipefail. - Indentation is two spaces; prefer lowercase variable names for locals and uppercase for environment-configured values.
- Keep functions small and focused; add comments only where the intent is not obvious.
Testing Guidelines
- Automated tests live in
tests/and run withpython3 -m unittest discover -s tests -p 'test_*.py'.
Commit & Pull Request Guidelines
- Commit history is minimal and does not establish a convention; use short, imperative messages (e.g., "Add device override").
- PRs should include a concise description, repro steps, and any environment variables or dependencies added.
Configuration Tips
- Audio input is configured via the
recording.inputfield inconfig.json. - STT model and device are configured via the
sttsection inconfig.json. - LLM model settings are locked; model downloads to
~/.cache/lel/models/. -v/--verboseenables verbose logs (including llama.cpp) withllama::prefix.- Press
Escwhile recording to cancel without processing.