Skip to content

feat: support Linux Wayland clipboard via wl-clipboard#10

Merged
flamerged merged 1 commit into
masterfrom
feat/linux-wayland-clipboard
May 1, 2026
Merged

feat: support Linux Wayland clipboard via wl-clipboard#10
flamerged merged 1 commit into
masterfrom
feat/linux-wayland-clipboard

Conversation

@flamerged
Copy link
Copy Markdown
Owner

Phase 5 'big' item #3 of 3.

What

  • Auto-detect Wayland vs X11 via XDG_SESSION_TYPE / WAYLAND_DISPLAY
  • Wayland path: wl-paste --type image/png (read) + wl-copy (write)
  • X11 path: existing xclip code path, unchanged
  • Startup warning is session-aware (wl-clipboard hint for Wayland, xclip hint for X11)
  • Banner / log shows 'Linux (Wayland)' or 'Linux (X11)' so users see which path is active

Why

Modern Ubuntu/Fedora/etc. default to Wayland; xclip silently fails there. ~50% of Linux users were getting silent clipboard no-ops before this change.

Pre: only X11 was supported (xclip). Modern Ubuntu/Fedora/etc. default
to Wayland sessions where xclip silently fails — clipboard detection
quietly no-op'd for ~50% of Linux users.

Now: detect session type via XDG_SESSION_TYPE / WAYLAND_DISPLAY and
dispatch to the right tool:
- Wayland: 'wl-paste --type image/png' for read,
           'wl-copy --trim-newline' for write (stdin in both cases)
- X11:     existing 'xclip -selection clipboard' code path

Startup warnings are session-aware: a Wayland session missing
wl-clipboard prints the wl-clipboard install hint; an X11 session
missing xclip prints the xclip hint. No more cross-tool confusion.

The Linux env tag in the daemon banner now reads 'Linux (Wayland)'
or 'Linux (X11)' so users can tell which path they're on at a glance.
README updated accordingly.
@flamerged flamerged merged commit 37a9d2e into master May 1, 2026
2 checks passed
@flamerged flamerged deleted the feat/linux-wayland-clipboard branch May 1, 2026 13:26
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant