feat(activation): D-Bus activation for compositor global shortcuts (#568)

Rebased onto latest main (conflict-resolution squash for PR #568).

Co-authored-by: Alexander <ab@digital-benefits.de>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Web-Benefits
2026-09-29 21:19:29 -07:00
committed by GitHub
co-authored by Alexander Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent c0217a8aec
commit db07590761
10 changed files with 1077 additions and 9 deletions
+49
View File
@@ -104,6 +104,55 @@ the hotkey; Parakeet does not use the language picker at all. Active-layout
detection uses GNOME's input-source settings; on other desktops it falls back to
the configured primary layout.
### Activation via a KDE Plasma global shortcut
Instead of the built-in hotkey listener, you can let your desktop's global
shortcut system trigger Vocalinux. On Wayland the built-in listener reads
`/dev/input` (requiring membership in the `input` group and effectively acting
as a system-wide key reader). Delegating activation to the compositor avoids
this entirely: no `/dev/input` access and no `input` group needed just to
start/stop dictation. Text injection is unaffected.
Enable it in Vocalinux:
1. Open **Settings → Shortcuts** (the Keyboard Shortcuts group on the Dictation page)
2. Turn on **External Activation (Desktop Shortcut)**
The change applies immediately; you do not need to restart. The built-in key
listener stops, and a running instance exposes a D-Bus service on the session
bus (`com.vocalinux.Vocalinux`). The CLI can forward commands to it:
```bash
vocalinux --toggle # start if idle, stop if active
vocalinux --start # start voice typing
vocalinux --stop # stop voice typing
```
Then bind a compositor shortcut to `vocalinux --toggle`. On KDE Plasma:
1. Open **System Settings -> Keyboard -> Shortcuts -> Add New -> Command or Script**
(older Plasma: **System Settings -> Shortcuts -> Custom Shortcuts -> Edit ->
New -> Global Shortcut -> Command/URL**).
2. Bind a key combination of your choice to the command `vocalinux --toggle`.
Now your chosen key combination toggles dictation, handled by the compositor
rather than by Vocalinux reading the keyboard directly. This works the same way
on other compositors that support binding a key to a command (e.g. GNOME custom
shortcuts, Sway/Hyprland `bindsym`/`bind`).
As an advanced alternative, you can set the same option in
`~/.config/vocalinux/config.json` under `shortcuts`:
```json
"shortcuts": {
"disable_internal_hotkey": true
}
```
Quit Vocalinux before editing that file so the running app cannot overwrite
the edit from its cached config. Start Vocalinux again after saving.
### Model size (whisper.cpp / Whisper)
| Size | Approx. size | Tradeoff |