From 0b9718cf2c4af53f4eed7a1dc03c1f9cc63ed676 Mon Sep 17 00:00:00 2001 From: Jeena Date: Tue, 15 Sep 2026 08:31:16 +0900 Subject: [PATCH] hypr: add hold-to-talk voice dictation via whisrs Bind the Copilot key (SUPER+SHIFT+F23) to whisrs on press and release, so holding it records and letting go transcribes. Injection uses wtype, which works natively on Hyprland and reaches any focused window, including TUIs running in the dockerized agent containers. Decoding runs on the iGPU through the Vulkan feature of a locally rebuilt whisrs-git: the stock AUR build is CPU-only and compiled with generic -march, which made dictation take around five seconds. Requires whisrs-git (AUR), wtype and pipewire-alsa; documented in the README along with the config and model locations. --- README.md | 15 +++++++++++++++ hypr/keybindings.lua | 5 +++++ hypr/shortcuts.txt | 1 + 3 files changed, 21 insertions(+) diff --git a/README.md b/README.md index 9465314..edfc500 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,25 @@ You also need to install all the dependencies: portal startup script falls back to launching the portals manually.) - fcitx5 - fcitx5-hangul +- wtype (types the transcribed text) +- whisrs-git (AUR; voice dictation daemon, see below) There are probably more, I will update the list next time I'm installing it on a new computer. +Voice dictation +=============== + +The Copilot key (on newer laptops this replaced the right Ctrl key; it +sends SUPER+SHIFT+F23) toggles voice dictation. Press it once to start +recording and again to stop. whisrs transcribes locally with a +whisper.cpp model and types the text at the cursor via wtype, in any +window, including terminals running the dockerized agent harnesses. + +The config lives in ~/.config/whisrs/config.toml and the model in +~/.local/share/whisrs/models/. The daemon runs as the systemd user +service whisrs.service. + License ======= diff --git a/hypr/keybindings.lua b/hypr/keybindings.lua index b45c0bc..b2288ca 100644 --- a/hypr/keybindings.lua +++ b/hypr/keybindings.lua @@ -36,3 +36,8 @@ hl.bind(P.mainMod .. " + F1", hl.dsp.exec_cmd("~/.config/hypr/scripts/cheatsheet hl.bind(P.mainMod .. " + ALT + TAB", hl.dsp.pass({ window = "class:^(com.obsproject.Studio)$" })) hl.bind("F1", hl.dsp.pass({ window = "class:^(com.obsproject.Studio)$" })) hl.bind("F2", hl.dsp.pass({ window = "class:^(com.obsproject.Studio)$" })) + +-- Copilot key (sends SUPER+SHIFT+F23): hold-to-talk voice dictation via whisrs +-- press = start recording, release = stop and transcribe +hl.bind("SUPER + SHIFT + F23", hl.dsp.exec_cmd("whisrs toggle")) +hl.bind("SUPER + SHIFT + F23", hl.dsp.exec_cmd("whisrs toggle"), { release = true }) diff --git a/hypr/shortcuts.txt b/hypr/shortcuts.txt index b919446..69d0442 100644 --- a/hypr/shortcuts.txt +++ b/hypr/shortcuts.txt @@ -2,6 +2,7 @@ │ SUPER + T Open terminal │ │ SUPER + W Close focused window │ │ SUPER + B Open browser │ │ SUPER + M Exit Hyprland │ │ SUPER + E Open file manager │ │ SUPER + V Toggle floating │ +│ Copilot key Voice dictation │ └────────────────────────────────────────────────────┘ │ SUPER + P Pseudo split (dwindle) │ ┌───────────────── Focus Movement ───────────────────┐ │ SUPER + J Toggle split (dwindle) │ │ SUPER + ←/→/↑/↓ Move focus │ │ SUPER + F Toggle fullscreen │