From 529948cc1fc4673610f1dbfbc9fe54a4f1a23a0a Mon Sep 17 00:00:00 2001 From: Lorenz Egginger Date: Thu, 26 Aug 2021 18:07:41 +0200 Subject: [PATCH] Add 'XDG_SESSION_TYPE' check Choose the program 'wl-copy' that is used to copy a selection to the clipboard by checking the value of the environment variable 'XDG_SESSION_TYPE' in addition to the pure existence of the 'wl-copy' executable. --- scripts/helpers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 @@ clipboard_copy_command() { 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