78 lines
1.3 KiB
Markdown
78 lines
1.3 KiB
Markdown
# lel
|
|
|
|
X11 transcription daemon that records audio and runs Whisper, logging the transcript.
|
|
|
|
## Requirements
|
|
|
|
- X11 (not Wayland)
|
|
- `ffmpeg`
|
|
- `whisper` (OpenAI Whisper CLI)
|
|
- `xclip`
|
|
- Tray icon deps: `libappindicator3` and `gtk3` (required by `systray`)
|
|
|
|
## Build
|
|
|
|
```bash
|
|
go build -o leld ./cmd/leld
|
|
go build -o lelctl ./cmd/lelctl
|
|
```
|
|
|
|
## Config
|
|
|
|
Create `~/.config/lel/config.toml`:
|
|
|
|
```toml
|
|
hotkey = "Cmd+m"
|
|
ffmpeg_input = "pulse:default"
|
|
whisper_model = "base"
|
|
whisper_lang = "en"
|
|
whisper_device = "cpu"
|
|
whisper_extra_args = ""
|
|
record_timeout_sec = 120
|
|
whisper_timeout_sec = 300
|
|
segment_sec = 5
|
|
streaming = false
|
|
```
|
|
|
|
Env overrides:
|
|
|
|
- `WHISPER_MODEL`, `WHISPER_LANG`, `WHISPER_DEVICE`, `WHISPER_EXTRA_ARGS`
|
|
- `WHISPER_FFMPEG_IN`
|
|
- `WHISPER_STREAM`, `WHISPER_SEGMENT_SEC`, `WHISPER_TIMEOUT_SEC`
|
|
- `LEL_RECORD_TIMEOUT_SEC`, `LEL_HOTKEY`
|
|
|
|
## Run manually
|
|
|
|
```bash
|
|
./leld --config ~/.config/lel/config.toml
|
|
```
|
|
|
|
Disable the tray icon:
|
|
|
|
```bash
|
|
./leld --no-tray
|
|
```
|
|
|
|
## systemd user service
|
|
|
|
```bash
|
|
mkdir -p ~/.local/bin
|
|
cp leld lelctl ~/.local/bin/
|
|
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.
|
|
|
|
Control:
|
|
|
|
```bash
|
|
lelctl status
|
|
lelctl reload
|
|
lelctl stop
|
|
```
|