No description
Find a file
2026-02-26 15:11:06 -03:00
src Add interactive edit mode with floating popup 2026-02-26 15:11:06 -03:00
systemd Rename project from lel to aman 2026-02-25 11:11:10 -03:00
tests Add interactive edit mode with floating popup 2026-02-26 15:11:06 -03:00
.gitignore Update project files 2026-02-10 11:01:36 -03:00
AGENTS.md Rename project from lel to aman 2026-02-25 11:11:10 -03:00
config.example.json Add interactive edit mode with floating popup 2026-02-26 15:11:06 -03:00
Makefile Rename project from lel to aman 2026-02-25 11:11:10 -03:00
pyproject.toml Rename project from lel to aman 2026-02-25 11:11:10 -03:00
README.md Add interactive edit mode with floating popup 2026-02-26 15:11:06 -03:00
uv.lock Rename project from lel to aman 2026-02-25 11:11:10 -03:00

aman

Local amanuensis

Python X11 STT daemon that records audio, runs Whisper, applies local AI cleanup, and injects text.

Requirements

  • X11
  • sounddevice (PortAudio)
  • faster-whisper
  • llama-cpp-python
  • Tray icon deps: gtk3, libayatana-appindicator3
  • Python deps (core): numpy, pillow, faster-whisper, llama-cpp-python, sounddevice
  • X11 extras: PyGObject, python-xlib

System packages (example names): portaudio/libportaudio2.

Ubuntu/Debian
sudo apt install -y portaudio19-dev libportaudio2 python3-gi gir1.2-gtk-3.0 libayatana-appindicator3-1
Arch Linux
sudo pacman -S --needed portaudio gtk3 libayatana-appindicator
Fedora
sudo dnf install -y portaudio portaudio-devel gtk3 libayatana-appindicator-gtk3
openSUSE
sudo zypper install -y portaudio portaudio-devel gtk3 libayatana-appindicator3-1

Python Daemon

Install Python deps:

X11 (supported):

uv sync --extra x11

Config

Create ~/.config/aman/config.json (or let aman create it automatically on first start if missing):

{
  "daemon": {
    "hotkey": "Cmd+m",
    "edit_hotkey": "Cmd+Shift+m"
  },
  "recording": { "input": "0" },
  "stt": { "model": "base", "device": "cpu" },
  "injection": {
    "backend": "clipboard",
    "remove_transcription_from_clipboard": false
  },
  "vocabulary": {
    "replacements": [
      { "from": "Martha", "to": "Marta" },
      { "from": "docker", "to": "Docker" }
    ],
    "terms": ["Systemd", "Kubernetes"]
  }
}

Recording input can be a device index (preferred) or a substring of the device name.

Hotkey notes:

  • Use one key plus optional modifiers (for example Cmd+m, Super+m, Ctrl+space).
  • Super and Cmd are equivalent aliases for the same modifier.
  • daemon.hotkey and daemon.edit_hotkey must be different.

AI cleanup is always enabled and uses the locked local Llama-3.2-3B GGUF model downloaded to ~/.cache/aman/models/ during daemon initialization.

Use -v/--verbose to enable DEBUG logs, including recognized/processed transcript text and llama.cpp logs (llama:: prefix). Without -v, logs are INFO level.

Vocabulary correction:

  • vocabulary.replacements is deterministic correction (from -> to).
  • vocabulary.terms is a preferred spelling list used as hinting context.
  • Wildcards are intentionally rejected (*, ?, [, ], {, }) to avoid ambiguous rules.
  • Rules are deduplicated case-insensitively; conflicting replacements are rejected.

STT hinting:

  • Vocabulary is passed to Whisper as hotwords/initial_prompt only when those arguments are supported by the installed faster-whisper runtime.

systemd user service

mkdir -p ~/.local/share/aman/src/assets
cp src/*.py ~/.local/share/aman/src/
cp src/assets/*.png ~/.local/share/aman/src/assets/
cp systemd/aman.service ~/.config/systemd/user/aman.service
systemctl --user daemon-reload
systemctl --user enable --now aman

Usage

  • Press the hotkey once to start recording.
  • Press it again to stop and run STT.
  • Press Esc while recording to cancel without processing.
  • Esc is only captured globally while dictation recording is active.
  • Transcript contents are logged only when -v/--verbose is used.

Edit mode:

  • Copy text to clipboard and press daemon.edit_hotkey.
  • Aman opens an editable popup with the clipboard snapshot and immediately starts recording an instruction.
  • If clipboard is empty, the popup opens with empty text so the first instruction can create content.
  • Press daemon.edit_hotkey again to stop recording and apply the instruction.
  • Repeat to iterate with more voice instructions.
  • Press Enter to close the popup and inject the final text.
  • Press Ctrl+C to copy final text to clipboard and close the popup (no injection).
  • Press Esc to cancel the edit session completely.
  • While edit mode is open, the normal dictation hotkey is ignored.

Wayland note:

  • Running under Wayland currently exits with a message explaining that it is not supported yet.

Injection backends:

  • clipboard: copy to clipboard and inject via Ctrl+Shift+V (GTK clipboard + XTest)
  • injection: type the text with simulated keypresses (XTest)
  • injection.remove_transcription_from_clipboard: when true and backend is clipboard, restores/clears the clipboard after paste so the transcript is not kept there

AI processing:

  • Local llama.cpp model only (no remote provider configuration).

Control:

make run
make check