Skip to content

ydotool leaks a new virtual input device on every invocation #7

Closed

Description

@csheaff

Problem

Each call to ydotool type (line 100 of talktype) creates a new kernel virtual input device (/dev/input/eventN). These devices are never cleaned up until reboot, so they accumulate over a session.

On systems with ydotool 0.1.8 (the version packaged in Ubuntu/Debian), there is no ydotoold daemon — each invocation creates and destroys its own uinput device, but the kernel input node persists.

Observed behavior

From journalctl on a single 16-minute session:

  • 42 talktype invocations (via GNOME keyboard shortcut)
  • 21 new virtual input devices created (input32 through input52), one per transcribe-and-type cycle
  • systemd-logind began monitoring each new device ("Watching system buttons on /dev/input/event22 (ydotool virtual device)")
  • ydotool warned on every invocation: ydotoold backend unavailable (may have latency+delay issues)
  • Session ended with gnome-shell libinput errors and a system crash (kdump triggered)

The device accumulation is a resource leak. While it may not be the sole cause of the crash, it adds unnecessary kernel and input subsystem load that grows with each invocation.

Environment

  • Ubuntu (kernel 6.17.0-14-generic), GNOME on Wayland
  • ydotool 0.1.8-3build1 (no ydotoold daemon available)

Possible fixes

  1. Detect missing ydotoold and warn — check for the daemon on startup and log a warning or refuse to run
  2. Document ydotoold as a requirement — add to check_deps and README
  3. Consider alternative typing methods — e.g. wtype on Wayland, wl-clipboard with wl-paste, or composing via DBus

Activity

  1. csheaff commented on Feb 15, 2026

    @csheaff
    OwnerAuthor

    Fixed in #8. talktype now auto-detects the best typing tool:

    1. wtype (Wayland — Sway, Hyprland)
    2. ydotool + ydotoold (if daemon is running)
    3. xdotool (X11 only)
    4. bare ydotool (last resort, with once-per-session warning about device leak)

    Each tool is tried and falls through on failure, so e.g. wtype being installed but unsupported by the compositor (GNOME) doesn't block the fallback. Configurable via TALKTYPE_TYPE_CMD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions