Skip to content

Double-typing / repeated characters when using ydotool on Wayland (NixOS) #381

@zitongcharliedeng

Description

@zitongcharliedeng

Description

When using Speech Note's active-window dictation mode with ydotool on Wayland (NixOS + niri compositor), transcribed text frequently contains doubled or repeated characters/words. For example, "hello world" might be typed as "hhello wworld" or words get repeated entirely.

Environment

  • OS: NixOS 24.11+ (flake-based)
  • Compositor: niri (Wayland, no X11/XWayland)
  • Audio: PipeWire
  • Speech Note: Flatpak (net.mkiol.SpeechNote) from Flathub
  • ydotool: System ydotoold with socket at /run/ydotoold/socket (0666 perms for Flatpak access)
  • Model: Whisper (medium)

Steps to Reproduce

  1. Install Speech Note via Flatpak on a pure Wayland compositor (no XWayland)
  2. Configure ydotoold with accessible socket
  3. Grant Speech Note Flatpak access to ydotool socket via overrides
  4. Use start-listening-active-window D-Bus action to begin dictation
  5. Speak a sentence and observe the typed output

Expected Behavior

Each character/word is typed exactly once.

Actual Behavior

Characters or words are duplicated. Appears to be a key-repeat race condition — ydotool may be sending key-down events without sufficient delay before key-up, causing the compositor to interpret them as repeated keys.

Possible Root Cause

The typing delay between keystrokes in ydotool integration may be too short for some Wayland compositors. A configurable inter-keystroke delay or using ydotool's type --delay flag could help.

Workaround

Using Handy (cjpais/Handy) instead, which uses evdev-based direct input (HandyKeys) and doesn't exhibit this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions