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

swappy is not actually trying to use xclip? #157

Open
mleue opened this issue Nov 15, 2023 · 4 comments
Open

swappy is not actually trying to use xclip? #157

mleue opened this issue Nov 15, 2023 · 4 comments
Labels
wontfix This will not be worked on

Comments

@mleue
Copy link

mleue commented Nov 15, 2023

swappy version 1.5.1

Thanks for this awesome little tool. It is the sweet spot in terms of complexity/features for me.
I've been using it on wayland/sway for a while with no issues. Lately I've found myself on x11/i3 for various reasons and wanted to recreate my tooling around screenshots/screencapture.

I wasn't expecting swappy to work in x11 (since it brands itself as wayland-native), but most of it does apparently. The only thing that doesn't currently work is copying to clipboard.

Swappy complains that one of wl-copy, xclip or others needs to be installed. I do have xclip, but it still fails.

The responsible line in code seems to be here:

execlp("wl-copy", "wl-copy", "-t", "image/png", NULL);

As far as I can see, swappy warns that some clipboard utility must be present, but the only one it actually tries to use is wl-copy.

Am I right here? Could we alter the behaviour to actually try the alternatives as well?

Thanks in advance. :)

@n3oney
Copy link

n3oney commented Nov 18, 2023

As a workaround, you could just make a simple bash script that would route wl-copy to xclip

@jtheoof
Copy link
Owner

jtheoof commented Apr 7, 2024

There is no standard way to access clipboard API in Linux as far as I know. And as you mentioned swappy is targeting wayland ecyosystem. So relying to external tool is not ideal but I don't see a better way at the moment. The workaround provided by @n3oney would do the trick I believe.

@jtheoof jtheoof added the wontfix This will not be worked on label Apr 7, 2024
@Goosegit11
Copy link

Goosegit11 commented Apr 7, 2024

There is no standard way to access clipboard API in Linux as far as I know.

There is cb, maybe it would work?

@fictitiousexistence
Copy link

Since this is marked as wontfix and xclip will not work, how about changing the warning on lines 37-38 from

"Unable to copy contents to clipboard. Please make sure you have "
"`wl-clipboard`, `xclip`, or `xsel` installed.");

to

"Unable to copy contents to clipboard. Please make sure you have "
"`wl-clipboard` installed.");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants