Skip to content

Conversation

@gabrielste1n
Copy link
Collaborator

Summary

  • Add linux-fast-paste native C binary using XTest extension for fast, reliable paste simulation on X11 and XWayland apps
  • Built-in terminal detection automatically switches between Ctrl+V and Ctrl+Shift+V
  • Compositor-aware fallback chain: detects wlroots (Sway/Hyprland), GNOME, KDE and orders system tools accordingly
  • ydotool daemon pre-check prevents silent failures when daemon isn't running
  • Build script with hash-based staleness detection; gracefully degrades if X11 dev headers are missing
  • CI workflow updated with libx11-dev/libxtst-dev build dependencies
  • Deduplicated binary resolution logic into shared _resolveNativeBinary() helper

Test plan

  • Verify Linux build succeeds in CI with new apt dependencies
  • Test paste on X11 desktop (native binary should be used)
  • Test paste on GNOME Wayland (native binary for XWayland apps, xdotool fallback)
  • Test paste on Sway/Hyprland (wtype preferred, native binary fallback)
  • Verify macOS and Windows builds are unaffected (build script exits early on non-Linux)
  • Confirm PasteToolsInfo shows "built-in (XTest)" when native binary is available
  • Test graceful fallback when native binary is missing or fails

…allbacks

Add linux-fast-paste native C binary using XTest extension for fast,
reliable paste simulation on X11 and XWayland. Includes built-in
terminal detection (Ctrl+Shift+V vs Ctrl+V) and graceful fallback
to compositor-aware system tools (xdotool, wtype, ydotool).

- Native binary tried first; falls back to system tools on failure
- Compositor detection: wlroots (Sway/Hyprland), GNOME, KDE
- Priority ordering per compositor (wtype first on wlroots, xdotool
  first on GNOME/KDE)
- ydotool daemon check prevents silent failures
- Build script with hash-based staleness detection, graceful
  degradation when X11 dev headers are missing
- CI workflow updated with libx11-dev/libxtst-dev dependencies
- Extracted shared _resolveNativeBinary helper to deduplicate
  macOS and Linux binary resolution logic
Switch ydotool from scan codes to key names (ctrl+v) for compatibility
with Ubuntu's bundled ydotool 0.1.8. Remove redundant comments that
restate what the code already communicates.
…aste

Capture the active window ID via xdotool before the fast-paste binary
runs, then pass it via --window so keystrokes go to the correct window.
The C binary now accepts --window and --terminal flags and activates the
target window using _NET_ACTIVE_WINDOW + XSetInputFocus.

Also deduplicates the terminal class list in clipboard.js and adds
ghostty, guake, tilda, hyper, tabby, sakura, and warp.
Add /dev/uinput code path to the native paste binary so it can inject
keystrokes at the kernel level on Wayland, bypassing the XTest/XWayland
limitation that silently fails for native Wayland windows on KDE/GNOME.

- Binary accepts --uinput flag; conditionally compiled with -DHAVE_UINPUT
- Build script auto-detects linux/uinput.h availability
- JS orchestration passes --uinput on Wayland, falls back to XTest then
  system tools if uinput is unavailable (exit codes 3/4)
- Demote xdotool/wtype from Recommends to Suggests in DEB/RPM packaging
  to prevent auto-reinstall overriding user tool preferences

Closes #253
- checkPasteTools no longer reports available when native binary exists
  but can't work (pure Wayland without uinput or XWayland)
- Build hash now includes uinput header availability so installing
  linux-headers triggers a rebuild with -DHAVE_UINPUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant