Skip to content

Paste dictation and clipboard entries through Hyprland so XWayland apps receive them - #16537

Open
bscott wants to merge 3 commits into
omacom:quattrofrom
bscott:fix/voxtype-xwayland-paste
Open

bscott wants to merge 3 commits into
omacom:quattrofrom
bscott:fix/voxtype-xwayland-paste

Conversation

@bscott

@bscott bscott commented Oct 25, 2026

Copy link
Copy Markdown

Fixes #16536

Voxtype dictation, the clipboard history paste and the emoji picker all send keys through wtype, which XWayland apps read as Escape, digits and letters. Dictating into the ChatGPT or Hermes desktop app (both XWayland) types something like 1234315671635789430-=724qw764ert7yuio, and the paste chord arrives as Shift+Escape. The issue has the reproduction and a delivery matrix.

Hyprland can press the keys itself on the seat's own keymap, which XWayland apps receive as sent. Omarchy's universal copy and paste bindings already do this in default/hypr/bindings/clipboard.lua.

What changes

  • omarchy-hyprland-send-shortcut <mods> <key> (hidden) sends a chord to the focused surface through hl.dsp.send_key_state, with the same no-window-target and down/up split as clipboard.lua.

  • omarchy-clipboard-paste-text, omarchy-clipboard-paste-file and omarchy-menu-emoji-insert send their Shift+Insert through it instead of wtype -M shift -k Insert -m shift.

  • Voxtype has no keystroke driver that goes through the compositor, so default/voxtype/config.toml switches to mode = "clipboard" and pastes from the output hooks: pre_output_command = "omarchy-voxtype-output begin", post_output_command = "omarchy-voxtype-output end".

    • Voxtype runs post_output_command after cancelled and empty recordings too, so end only pastes after a begin. That keeps a cancelled recording from pasting whatever was on the clipboard.
    • begin arms nothing unless the configured mode is clipboard, so a user who switches back to type or paste mode doesn't get the transcript twice.
    • end waits 100 ms before pasting, as voxtype's own paste mode does.
  • Existing voxtype configs are left alone, since the new mode changes clipboard behaviour (below). To opt in:

    voxtype config set output.mode clipboard
    voxtype config set output.pre_output_command "omarchy-voxtype-output begin"
    voxtype config set output.post_output_command "omarchy-voxtype-output end"
    systemctl --user restart voxtype.service

Note on migration

This PR deliberately ships no migration, so existing installs keep type mode and stay broken in XWayland apps until they opt in. I wrote and tested one and left it out because it would change clipboard behaviour for existing users without asking. That's a call for maintainers, and #15490 carries a competing migration. If you want it, I can add it here or in a follow-up. It:

  • applied only to configs still on the output Omarchy shipped: mode = "type", no driver_order, and no pre_output_command or post_output_command. Any config that chose its own output was left alone.
  • switched them with voxtype config set, which keeps comments and other settings.
  • restarted the daemon only when voxtype status was idle, so a recording in progress picked the change up at its next restart.
  • was checked against a copy of a real 4.0.6 config (switched), a rerun (no change), a config with a custom driver_order (untouched), and a machine with no voxtype config (no-op).

Trade-off

Dictation on new installs now replaces the clipboard, as #15490 and #13098 would. The previous entry stays in clipboard history (Super + Ctrl + V). Paste also delivers characters wtype drops even in native apps (the em dash in the issue's matrix) and lands the whole transcript at once, which removes the focus drift #6589 guards against.

Relation to open PRs

#15490 moves voxtype to paste mode with Shift+Insert, but voxtype sends paste_keys through wtype first, so XWayland apps still get Shift+Escape. This PR gets the same paste behaviour with the chord sent by Hyprland. On the output mode it would supersede #15490 and #9641. Unlike #15490 it doesn't migrate existing configs.

Testing

  • bash test/shell.d/dictation-test.sh, clipboard-test.sh, emojis-test.sh, and ./test/cli
  • The new dictation test fails without the arm guard: a cancelled recording (end without begin) or type mode must not paste.
  • Hyprland 0.56.2, voxtype-bin 1.1.1, wtype 0.4, with an Electron 43 textarea under --ozone-platform=x11 and --ozone-platform=wayland, and a GTK key logger under both GDK backends: Hyprland's Shift+Insert pasted Dictation into ChatGPT — café, naïve 123. intact in both, where wtype's Shift+Insert pasted nothing under XWayland.
  • Moved a real Omarchy 4.0.6 voxtype config to the new settings with the commands above, then dictated into the ChatGPT and Hermes desktop apps. The voxtype log shows both hooks completing, and the transcripts arrived intact.

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous restart-and-cancel issue is fixed, and no new actionable issues were found.

Summary

Clipboard history, file paste, and emoji insertion now send Shift+Insert through Hyprland. New Voxtype configs use clipboard output with hooks that paste the transcript.

  • Clipboard, file, and emoji pastes send their shortcut through Hyprland.
  • New Voxtype configs paste dictation through Hyprland.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Voxtype begin hook] --> B{Clipboard mode?}
  B -->|Yes| C[Save daemon InvocationID]
  B -->|No| D[Remove marker]
  C --> E[Voxtype copies transcript]
  E --> F[Voxtype end hook]
  G[Cancelled or empty recording] --> F
  F --> H{Marker belongs to current run?}
  H -->|Yes| I[Hyprland sends Shift+Insert]
  H -->|No marker or different run| J[Do not paste]
Loading

Reviews (3) · Last reviewed commit: "Ignore a Voxtype paste marker left by an..." · Reviewed by Greptile

Comment thread bin/omarchy-voxtype-output Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Triage classified this pull request before reviewing it, and the two classifiers did not agree, so it has no class label yet and the full review (worker run, suite, second-opinion review) has not started.

  • Claude Opus 5.5 read it as a bug fix: the default voxtype type mode, clipboard history paste (omarchy-clipboard-paste-text --shift-insert, omarchy-clipboard-paste-file) and omarchy-menu-emoji-insert all go through wtype, which XWayland apps receive as Escape and digits, as XWayland apps get Escape and digits from Voxtype dictation, and nothing from clipboard history or emoji paste #16536 reports.
  • Codex Medium read it as an enhancement. The likely reason is that default/voxtype/config.toml moves new installs from mode = "type" to mode = "clipboard" with new output hooks, a deliberate behaviour change (dictation now replaces the clipboard) and not just a repair of the existing path.

Both readings are reasonable, since the paste-helper half is a straight fix and the voxtype default is a change of behaviour. The maintainer decides which it is, or whether to split it into two pull requests. GitHub also reports that this branch currently conflicts with quattro.

Waiting on the maintainer for the classification. Nothing was run or pushed.

@priard

priard commented Nov 5, 2026

Copy link
Copy Markdown

Confirming the bug and that this approach fixes it.

On Omarchy 4.5.0-3 (Hyprland 0.56.2), picking an entry in the clipboard manager (Super+Ctrl+V → Enter) did not reliably paste into the focused window in Foot, T3Code or Zen Browser. The entry reached the clipboard, but the wtype Shift+Insert chord was not acted on.

I patched a local clone of the clipboard plugin to do what this PR does: copy with the stock --copy-only helper, then send the chord through hl.dsp.send_key_state (via hyprctl eval). The window gets Ctrl+V, or Ctrl+Shift+V when it has the terminal tag, with the same down/up split as default/hypr/bindings/clipboard.lua. With that change, Enter pastes correctly in all three apps.

…ive them

wtype types through a keymap XWayland clients never load, so its
Shift+Insert reaches them as Shift+Escape and nothing is pasted. The
clipboard history paste, file paste and emoji picker now send the chord
through Hyprland's send_key_state, as the universal clipboard bindings do.
In type mode wtype's keys reach XWayland apps, such as the ChatGPT and
Hermes desktop apps, as Escape and digits instead of the transcript.
New installs copy the transcript and paste it from the output hooks with
a Shift+Insert sent by Hyprland. The hooks only paste after real output,
not after a cancelled or empty recording, and only in clipboard mode.
@bscott
bscott force-pushed the fix/voxtype-xwayland-paste branch from 4954a80 to 7feb244 Compare November 14, 2026 18:30
@bscott

bscott commented Nov 14, 2026 •

Copy link
Copy Markdown
Author

Rebased onto current quattro. I split the plain clipboard/emoji paste fix out into #18935; this PR keeps the Voxtype default change and is stacked on it.

If Voxtype stopped between its pre and post output hooks, the marker
survived the restart, and cancelling the next recording pasted whatever
was on the clipboard. The marker now holds the service's systemd
invocation id, and the paste only happens when it still matches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XWayland apps get Escape and digits from Voxtype dictation, and nothing from clipboard history or emoji paste

3 participants