feat: support Linux Wayland clipboard via wl-clipboard#10
Merged
Conversation
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.
|
🎉 This PR is included in version 0.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5 'big' item #3 of 3.
What
XDG_SESSION_TYPE/WAYLAND_DISPLAYwl-paste --type image/png(read) +wl-copy(write)xclipcode path, unchangedWhy
Modern Ubuntu/Fedora/etc. default to Wayland; xclip silently fails there. ~50% of Linux users were getting silent clipboard no-ops before this change.