kutsan / zsh-system-clipboard

System clipboard key bindings for Zsh Line Editor with vi mode. It is similar to what `set clipboard=unnamed` does for vim.
GNU General Public License v3.0
149 stars 16 forks source link

Added wayland detection. #48

Closed cronyakatsuki closed 1 year ago

cronyakatsuki commented 1 year ago

Hello. I added wayland session detection for users that use both wayland and x11 on the same system because before if you used both wayland and x11 if you were in x11 session wl-clipboard would be used so clipboard wouldn't be working and wl-clipbboard would print that no wayland session is on.

doronbehar commented 1 year ago

This is exactly the anti-pattern I tried to avoid in #43 . See also my comments in #45 .

Your change is different though from #45. Is there any reason that for your specific case you can't use on of the options of ZSH_SYSTEM_CLIPBOARD_METHOD?

cronyakatsuki commented 1 year ago

Using ZSH_SYSTEM_CLIPBOARD_METHOD could be a good soulution, but as somebody who changes between x11 and wayland quite frequently I had to make something similar to this in my zsh config.

Same detection as with what I added directly into the plugin itself.

If you personally find that adding the logic into the plugin itself to be too complicated. I wouldn't mind to make another pull request or remaking this one to mention in the README on how do this logic in the .zshrc so that other people won't be trying to open a similar issue or pull request.

doronbehar commented 1 year ago

I will be willing to accept a README change, but think about it that power users like you that use X11 and wayland interchangeably, usually know how to set environment variables conditionally in their shell files.

cronyakatsuki commented 1 year ago

I will be willing to accept a README change, but think about it that power users like you that use X11 and wayland interchangeably, usually know how to set environment variables conditionally in their shell files.

Yes I can see where your logic is coming from so yeah, I also don't really see adding in README as trully needed since as you said, power users will know how to do it themself.

I will be closing this pr then since it is unneded.