Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Linux/Wayland with wl-paste #1

Merged
merged 1 commit into from Aug 17, 2021

Conversation

craSH
Copy link
Contributor

@craSH craSH commented Aug 15, 2021

Changes

This modifies linux.sh to support Wayland systems that do not use the
xclip command.

Logic is added to attempt to determine the type of display in use
(X11/Xorg or Wayland), and based on that, try the common clipboard CLI
commands for the given display system.

Failing to determine the display system for any reason will fall back to
the original behavior that assumes xclip is present.

This change also resulted in refactoring the script a bit since it got a
bit more complicated, any style changes are in-line with the Google
shell style guide (https://google.github.io/styleguide/shellguide.html)

A minor change to extension.ts was also made to support the error case
of wl-paste note being present on Wayland systems.

Related issues

This change should resolve dendronhq/dendron#1095 - which I perhaps should have filed in this repo :)

Testing

I have tested the linux.sh script and it behaves as expected, but I have not tested this end-to-end as a VS Code extension, as I'm just not familiar with extension development yet. So hopefully it's good there, but please do test that before merging!

This modifies linux.sh to support Wayland systems that do not use the
xclip command.

Logic is added to attempt to determine the type of display in use
(X11/Xorg or Wayland), and based on that, try the common clipboard CLI
commands for the given display system.

Failing to determine the display system for any reason will fall back to
the original behavior that assumes xclip is present.

This change also resulted in refactoring the script a bit since it got a
bit more complicated, any style changes are in-line with the Google
shell style guide (https://google.github.io/styleguide/shellguide.html)

A minor change to extension.ts was also made to support the error case
of wl-paste note being present on Wayland systems.

This change should resolve dendronhq/dendron#1095
@kevinslin kevinslin merged commit 95f96b2 into dendronhq:main Aug 17, 2021
@craSH craSH deleted the linux-add-wayland-support branch May 3, 2023 09:53
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.

Dendron Paste Image: command is not aware of wayland CLI tools for interacting with clipboard
2 participants