Sway: Anyway of getting xclip and xsel working with sway?

Created on 3 May 2018  路  14Comments  路  Source: swaywm/sway

Hi, I noticed that even though they worked perfectly in gnome-shell wayland running native wayland apps, xclip and xsel no longer work with sway running native wayland apps (I've tested this with both the new alpha and 0.15). Is it a bug, is it by design or is it some feature that the gnome DE supports but Sway doesn't? Is there anything I can do to get them to work?

Most helpful comment

All 14 comments

It's by design. In 1.0 X11 clients will only be able to access the clipboard if a X11 window is focused.

You can use swaymsg to read and write the clipboard instead (not yet implemented in sway 1.0).

Nice! Is there something similar for reading selections?

swaymsg -t get_clipboard IIRC

Is the IIRC type available in 0.15 or is it a new feature planned to be implemented 1.0. I've tested swaymsg -t get_cliboard IIRC but it gives me a no matching type found error.

I see.... hahaha

I was able to get swaymsg -t get_cliboard TEXT

to grab clipboard content. Is there anyway of getting selection content (in the style of xsel)?

No, in sway 0.15 the primary selection is an X concept that isn't tracked by Sway. Just use xsel to get it.

xsel doesn't work on the wayland native windows (at least not in sway, for some reason it seems to work in gnome-shell wayland).

That's because Wayland native windows don't have a primary selection. In gnome they have a special primary selection protocol, which sway 1.0-alpha.1 supports.

Yey!!! :+1: That's great to know.

swaymsg -t get_cliboard TEXT

I noticed that the above command would cut off after 578 characters in Sway 0.15. Is this by design or a bug ? If it's by design, where can I modify the limit in the source code?

Search for "get_clipboard" in the source code? This is most likely a bug, and will be fixed in 1.0.

Ok. I'll way for the 1.0 release. Thanks emersion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dnkl picture dnkl  路  4Comments

jakubn551 picture jakubn551  路  4Comments

mcmfb picture mcmfb  路  3Comments

cauebs picture cauebs  路  3Comments

soymjolk picture soymjolk  路  3Comments