Existing settings keep the old 60ms delay, which on Wayland can restore the
old clipboard before the app has fetched the transcript (#502). The What's New
note tells Direct users to switch, so they would land on exactly that. Anyone
not pasting through the clipboard today has never used the delay, so bumping
theirs changes nothing until they switch; clipboard users keep their value.
Direct typing turns each character into a keycode, so on Linux it drops
capitals and accents and types the wrong characters on non-US layouts
(#429, #439, #1853). Shift+Insert pastes in GUI apps and terminals alike
once the transcript is also on the primary selection, which kitty, Ghostty,
Alacritty, xterm and VTE read; both are restored afterwards.
New installs get Shift+Insert and a longer restore delay, since Linux apps
fetch the clipboard only when they handle the key. Existing settings are left
alone; a Linux-only What's New note suggests switching. Release notes can now
be platform-specific for that.
Also fixes the enigo Shift+Insert fallback, which sent the keysym for 'v'
and typed 'V'.
* fix(windows): copy the transcript when the focused app runs as administrator
Windows drops keystrokes sent from Handy to an elevated window, and
SendInput isn't documented to report it, so a paste there can fail with
nothing shown. Check the focused window's integrity level before
pasting; when it outranks Handy, leave the transcript on the clipboard
and raise a notice that says to press Ctrl+V.
Refs #434
* fix(windows): only report a paste an elevated window blocks
Leaving the transcript on the clipboard overrode the user's Clipboard
Handling setting. Run the paste exactly as configured and change only
what Handy reports: an error naming the cause, with History as the way
to get the text.
Refs #434
* docs: note Windows admin app limitations
An installed but unusable tool (ydotool without ydotoold, wtype on a
compositor without virtual-keyboard support) aborted the paste even when
another tool or enigo could have sent the keys. ydotool also prints its
errors on stdout, so the log showed an empty 'ydotool failed:'.
* Find the ydotoold socket when YDOTOOL_SOCKET is unset
Fedora and NixOS run the daemon on sockets the ydotool client does not
look at, and autostarted Handy lacks the shell variable, so paste failed
with an empty error. Pass the first existing known socket to every
ydotool call and include stdout and the socket path in failures.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Simplify the socket lookup to one small function
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Only use ydotool sockets owned by root or the current user
/tmp is world-writable, so another local user could otherwise plant
/tmp/.ydotool_socket and receive dictated text as keystrokes.
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* Skip the Gamescope WSI Vulkan layer on Linux
Handy uses Vulkan only for ggml compute and never presents a swapchain,
and the Gamescope WSI layer aborts in vkroots during device creation on
SteamOS. Set DISABLE_GAMESCOPE_WSI=1 for Handy and its engine worker
unless the user already set it. Fixes the model-load crash in #2264.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* chore: drop SteamOS README note and trim Gamescope comments
The workaround is automatic, so users don't need README docs for it.
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: stop oversized Hugging Face downloads
* fix: bump hf-hub so downloads survive proxies that strip Range
Behind a proxy that strips Range, every chunk request got the whole file
with 200 and hf-hub accepted it: progress passed 100%, memory grew until
the app crashed, and the download never finished (#2100). hf-hub now
requires 206 for chunks and falls back to one sequential stream
(cjpais/hf-hub#2), so the download completes from Hugging Face directly.
Replaces this PR's earlier Handy-side byte-budget guard, which the hf-hub
fix makes unnecessary.
Co-authored-by: daydreamer.jin <11205554+johnjheejin@users.noreply.github.com>
---------
Co-authored-by: daydreamer.jin <11205554+johnjheejin@users.noreply.github.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
Main already detects a take of all-zero samples (input_silent) but only
onboarding showed it. Raise a MicrophoneSilent dictation notice when such
a take produces nothing to type, so a muted mic or wrong default device
doesn't look like the model missed the speech.
Fixes#1899
A lost GPU device comes back from transcribe.cpp as a backend error, not
a crash, so the supervisor kept the worker and every later run failed
until Handy restarted (#2295). Treat a backend error from a run, feed or
finalize like a lost worker: retry once in a fresh GPU worker, since a
driver reset often clears it, and fall back to CPU if it fails again.
The coordinator executes Effect::Start inline, and the first activation
after startup spends ~400ms initializing the microphone. A release
queued behind that block was stamped at dequeue time, so a short tap
measured past the hold threshold, classified as a hold, and the
just-started recording stopped with zero samples (#2089).
Stamp each key event when the sender observes it and measure holds
edge-to-edge from those stamps. Debounce uses edge time too, so two
distinct presses are no longer falsely coalesced when the queue drains
late.
Trusting the model's own ja/ko detection keeps kanji-only Japanese from
being rewritten; only an English tag on mixed Mandarin/English needed
overriding. The preview now applies exactly the final paste's rule, so
the two can't disagree on short text.
Whisper tags a whole run with one language, so mixed Mandarin/English is
often detected as English and the Traditional/Simplified conversion was
skipped (#2239). Text with Han characters is now converted unless it has
kana or the language was pinned to Japanese/Korean. OpenCC only touches
Han characters, so English in the same text is unaffected. The live
preview uses the same rule so it matches the pasted text.
CI and the deb/rpm packages already depend on OpenBLAS, but BUILD.md didn't
list it, so source builds on Arch linked Netlib libblas and crashed on
cblas_sgemm (#2274).
* fix: say "no model selected" instead of a blank model-not-found error
When a cleaner deletes the selected model's files, startup clears the
selection and the shortcut then reported "Model not found: " with no
name. An empty selection now raises a NoModelSelected notice pointing
to Settings > Models, skips the pointless load, and clears when a model
loads. Fixes#2273.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix: translate the No Model Selected notice
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: skip pasting a transcript that is only a period
A short noise clip is zero-padded to 1.25s and Whisper often returns ".".
That is not speech, so the paste path treats it like an empty result.
* fix: treat punctuation-only transcripts as empty
Move the check to where the transcript is finalized, so post-processing and
history skip it too, and cover any output with no letters or digits.
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
A macOS privacy grant is tied to the app's code signature. After a
reinstall or update with a different signature, the old entry stays in
System Settings but no longer matches: macOS neither honors it nor asks
again, so onboarding waits forever. Reset Handy's Accessibility and
Microphone entries with tccutil just before asking, while the permission
reads as not granted, so no working grant is lost.
Supersedes #2057. Fixes#1618.
Co-authored-by: CJ Pais <cj@cjpais.com>
Co-authored-by: João Carlos <123jccml@gmail.com>
The shared client only bounds connecting, so an endpoint that accepts the
request and never answers left the post-processing model picker loading
forever. Listing models is a small call; 15 s is plenty.
A non-resizable GTK window takes its content's natural height, and
WebKitWebView reports 200px, so on X11 the overlay grew from 50px to
200px after its position had been computed for 50px. The card is
anchored to the window's bottom edge, so at Bottom it was drawn below
the monitor (#1950). Top was unaffected. Wayland keeps the old setting.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix: disable updater where the build cannot install updates
On Linux the updater plugin runs dpkg or rpm by bundle type, or swaps an
AppImage. AUR and source builds have no dpkg or no bundle type, so the
update prompt led to a password dialog and a failure. Treat those builds
like HANDY_DISABLE_UPDATER, and stop the locked text blaming the variable.
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
* chore: keep the original updater locked description
* fix: import BundleType from tauri::utils::config so the Linux build compiles
---------
Co-authored-by: Claude Sonnet <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* Let AppImage users opt into native Wayland
The AppImage hook forces GDK_BACKEND=x11 after the user's environment,
so GDK_BACKEND=wayland never reaches Handy. Copy HANDY_GDK_BACKEND into
GDK_BACKEND before GTK starts so the hook cannot override it. Default
stays X11 (tauri#8541); #1729 and #2034 need Wayland.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* refactor: drop unused return value from apply_handy_gdk_backend
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
The HTTP client only has a connect timeout, so an endpoint that accepts
the request and never answers held the dictation until some proxy gave
up (~100 s behind Cloudflare). One deadline around the whole step also
covers the structured-output -> legacy retry, which per-request
timeouts would double. On timeout it falls back like any other failure.
Fixes#2407
* fix: build the async runtime before streaming logs to the webview
With debug mode at Trace level (always the case with --debug), startup
deadlocks most of the time. The webview log target passes each record to
tauri::async_runtime::spawn. When that spawn is the first use of the
runtime, tokio logs at Trace while it builds the runtime, the record goes
back to the webview target, and its spawn waits on the runtime's
OnceLock that the same thread is still initialising.
Build the runtime just before turning streaming on, while the webview
target is still off. On Xvfb and sway headless, --debug starts hung 9 of
10 and 5 of 5 before and 0 of 10 on both after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: trim runtime comment
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix(overlay): disable WebView2 context menu on the recording overlay
The overlay floats over other apps and was never configured to ignore
WebView2's defaults. A right-click that landed on it (for example from a
game) opened the browser menu (Back / Refresh / Save as / Print), and the
next click could pop a Print or Save As window over the foreground app.
Turn off default context menus and browser accelerator keys on the overlay
webview, Windows only, using the same with_webview pattern as the main
window. Left clicks still reach the cancel button and live editing.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(overlay): block the default context menu in the frontend instead
Preventing contextmenu in the overlay's JS covers every platform (WebView2,
WKWebView, WebKitGTK) without unsafe COM calls. Production builds only, so
Inspect stays available in dev.
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
WebKitGTK 2.54 composites only the damaged region of every frame. With the
DMA-BUF renderer disabled — the long-standing workaround for GPU crashes
(tauri-apps/tauri#9394) — those partial frames arrive in fresh shared-memory
buffers, so every pixel outside the damage becomes transparent. Handy's
frameless overlay card kept only its animated dot and waveform, which users
saw as a half-transparent card with the desktop showing through.
Pick the renderer from the WebKitGTK version linked into the process instead of
always disabling DMA-BUF: 2.54 and newer keep the compositor and move its swap
chain to shared memory (WEBKIT_DMABUF_RENDERER_FORCE_SHM=1), older releases
keep DMA-BUF off as before. Explicit values for either variable still win, and
the Nix wrapper no longer pins the renderer so the runtime policy applies.
Verified headlessly against WebKitGTK 2.54.1 (private sway output, production
environment): before the change a 6940 px recording card painted 600 px, after
it the full compact card and the expanded panel paint exactly as on WebKitGTK
2.52.6, while an explicit WEBKIT_DISABLE_DMABUF_RENDERER=1 still reproduces the
old behavior.
Refs #2166.
* feat(tray): add language switching submenu
Switching transcription language meant opening the settings window, which
is slow when a model guesses the wrong language mid-session. The tray now
has a Language submenu for the selected model.
It mirrors the settings picker: the checked entry is what transcription
will actually use (via language_detection::status_for), Auto is disabled
when it can't work, and the person's spoken languages lead, followed by
the model's other languages by name.
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat(tray): keep the language submenu to spoken languages
A full list (about 100 for Whisper) buries the two or three languages
people switch between. Spoken languages, plus the active one, now lead,
and the model's other languages move into an Other Languages submenu.
Also match the settings picker when the detector isn't downloaded (show
the fallback, grey out Auto), hide the submenu when there's nothing to
choose, refresh it when a download or delete changes the options, and
rebuild after a click so re-picking the checked item doesn't uncheck it.
* chore: regenerate bindings for KeyboardImplementation::None doc comment
* perf(tray): skip the language detector lookup while dictating
The busy menu has no language submenu, so probing the HF cache for the
detector on every recording state change was wasted disk work on the
dictation path. Going idle rebuilds the menu with a fresh lookup.
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
dotool reads one command per line from stdin. Writing the whole text as a
single `type` command meant everything after the first newline was parsed
as dotool commands (key, click, mouseto, ...) instead of being typed.
Send each line as its own `type` command and line breaks as `key enter`,
matching how the other typing tools handle newlines.
On Wayland neither Tauri nor Handy Keys can grab global shortcuts, so users
bind 'handy --toggle-transcription' in their compositor instead. 'None' stops
Handy from registering shortcuts at all in that setup. Linux only in the UI.
* Add transcription hook
Add support for transcription hook - an executable script in app's data directory.
If `hooks/transcription` file exists, Handy runs it passing transcription text via stdin and
uses script stdout as a transcription result.
This approach is a flexible extension point for advanced users
(which nowadays means with access to coding LLM) akin to git hooks.
Here are some possible scenarios:
* simple transcription modifications
* a pipeline involving LLM processing, language detection and translation
* custom paste method (as Handy does nothing if transcription is empty)
* conditional processing based on the active application waiting for the input
See related:
* https://github.com/cjpais/Handy/discussions/168
* https://github.com/cjpais/Handy/discussions/162
* https://github.com/cjpais/Handy/discussions/916
* https://github.com/cjpais/Handy/discussions/911
* https://github.com/cjpais/Handy/discussions/834
* https://github.com/cjpais/Handy/discussions/847
* https://github.com/cjpais/Handy/discussions/833
* https://github.com/cjpais/Handy/discussions/662
* https://github.com/cjpais/Handy/discussions/601
* https://github.com/cjpais/Handy/discussions/335
* https://github.com/cjpais/Handy/pull/739
* https://github.com/cjpais/Handy/pull/638
* https://github.com/cjpais/Handy/pull/455
* https://github.com/cjpais/Handy/issues/157
* fix: run the transcription hook on every pasted transcription, and bound it
The hook lived inside TranscriptionManager::transcribe(), so streaming
transcriptions (finalize_stream) never reached it, while history retries and
the CLI benchmark did, meaning a custom-paste hook could paste when retrying a
history entry. It now runs in the paste path, after LLM post-processing, and
leaves history untouched.
A hung hook used to block the pipeline forever. It now runs as a tokio child
with kill_on_drop, under a 30s timeout and the cancel shortcut, falling back to
the original text. It also uses the portable-aware data dir, feeds stdin while
reading output to avoid pipe deadlocks, and strips one trailing newline so a
plain `echo` doesn't submit the line in a terminal.
* refactor: trim the transcription hook and its README section
Drops the unit tests and folds the timeout into run(), so one error path
covers spawn failures, non-zero exits and timeouts. The README section is cut
to a short description and one example.
* docs: note that the transcription hook doesn't inherit the shell's PATH
Handy launched from the Dock gets launchd's minimal PATH, so Homebrew
tools called from a hook aren't found.
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix(macos): add experimental AirPods Mode to stop silent recordings
While an iPhone plays through AirPods, macOS can open the AirPods
microphone and deliver only zero samples, so the recording transcribes
to nothing. handy-recorder can move the headset to the Mac while
recording (take_headset); expose it as an opt-in experimental setting
so it gets wider use before deciding whether it should be the default.
Fixes#1990
* fix: report rejected AirPods Mode changes through notices
The toast import was removed by the error notices framework (#2372).
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: restore shortcut fallback when manager startup fails
* refactor: create HotkeyManager before spawning its thread
HotkeyManager is Send and handy-keys runs its own listener threads, so it
does not need to be built on the manager thread. Building it in
HandyKeysState::new returns the startup error directly to the caller,
which then falls back to the Tauri implementation, without a startup
channel or helper module.
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: release late audio sources after leaving history
* chore: drop audio player lifecycle test harness
Too much harness to maintain for a narrow Linux-only leak; the fix itself is small and self-contained.
---------
Co-authored-by: daydreamer.jin <11205554+johnjheejin@users.noreply.github.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: name the audio playback position control
* fix: translate playback position labels across locales
---------
Co-authored-by: daydreamer.jin <11205554+johnjheejin@users.noreply.github.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: ignore IME confirmation Enter in custom words
* fix: preserve IME confirmation in language search inputs
* chore: drop IME browser fixtures and regression spec
---------
Co-authored-by: daydreamer.jin <11205554+johnjheejin@users.noreply.github.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat: add error notices framework
* feat: show notices on the overlay
* feat: show notices in the tray
* feat: list notices in the footer
* feat: warn when post-processing fails
* feat: report file job failures as notices
* fix: shorten notice titles that overflow the overlay
* fix: match notices to the session's overlay
* refactor: warn on skipped post-processing, reuse tray badges, trim comments and tests
* bindings
* feat: let the user dismiss notices from the footer
A notice only ended when its source next succeeded, so a failed file
transcription could badge the tray for the rest of the session. "Show"
now dismisses the notice, and each row has a close button. Dismissing
matches the code as well as the source, so a click on a row drawn before
a newer notice replaced it leaves the new one alone.
* refactor: show all toasts and notices in one panel and drop sonner
* fix: give file transcription failures their own notice title, and tidy notice clearing
The tray showed a full sentence for a failed file job because it reused
settings.history.transcribeFailed, which needed a special case in build.rs.
It now has errors.fileTranscriptionFailedTitle like every other notice.
Model loads clear their notice through notices::clear_matching rather than
the dismiss_notice Tauri command, and the load error no longer repeats
"Failed to load model" ahead of the worker's own message.