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

'copy selection to system clipboard' not working when using multiple windowing systems. #152

Open
hereGittyGitty opened this issue Jan 26, 2021 · 3 comments

Comments

@hereGittyGitty
Copy link

Hi there,

i can choose to use X11 or Wayland on my machine when logging in and therefore I have both xclip and wl-copy installed. Now wl-copy is always used when assigning the copy-command in the main function even though I might be using X11.

This is because the clipboard_copy_command checks solely on the existence of certain executables when deciding what to use for copying.

My first attempt to solve this would be the following patch:

diff --git a/scripts/helpers.sh b/scripts/helpers.sh
index 66beeec..ea5e017 100644
--- a/scripts/helpers.sh
+++ b/scripts/helpers.sh
@@ -148,7 +148,8 @@
         fi
     elif command_exists "clip.exe"; then # WSL clipboard command
         echo "cat | clip.exe"
-    elif command_exists "wl-copy"; then # wl-clipboard: Wayland clipboard utilities
+    elif command_exists "wl-copy" \
+        && [ ${XDG_SESSION_TYPE} = "wayland" ]; then # wl-clipboard: Wayland clipboard utilities
         echo "wl-copy"
     elif command_exists "xsel"; then
         local xsel_selection

Thx for the plugin though. :)

@ariel-miculas
Copy link

I have the same issue, I was using wayland and wl-copy, then I've uninstalled wayland and the plugin no longer worked. It should use wl-copy only if a wayland server is available, otherwise use xsel/xclip.

@StopMotionCuber
Copy link

I'm also having this issue, and your patch seems sensible. Could you create a PR with your patch?

@hereGittyGitty
Copy link
Author

I'm also having this issue, and your patch seems sensible. Could you create a PR with your patch?

Done that :) see #153

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

No branches or pull requests

3 participants