Ver código fonte

Check DISPLAY_WAYLAND env variable to decide whether to use wl-copy (#500)

It has been pointed out by @bugaevc that a user may have X and
Wayland software available on the same system (e.g. for testing
purposes) and that the best way to determine whether to use
xsel/xclip or wl-copy is not to merely check for the presence of
these commands, but to check whether the `WAYLAND_DISPLAY`
environment variable is set. That is what this commit does.
pull/502/head
Dominic Delabruere 5 anos atrás
committed by Guillaume Vincent
pai
commit
4b22062ee5
1 arquivos alterados com 5 adições e 1 exclusões
  1. +5
    -1
      cli/lesspass/clipboard.py

+ 5
- 1
cli/lesspass/clipboard.py Ver arquivo

@@ -1,3 +1,4 @@
import os
import platform
import subprocess
import uuid
@@ -20,7 +21,10 @@ def get_system_copy_command():
if platform.system() == "Darwin" and _copy_available("pbcopy"):
return "pbcopy"

for command in ["xsel", "xclip", "wl-copy"]:
if os.getenv("WAYLAND_DISPLAY") is not None and _copy_available("wl-copy"):
return "wl-copy"

for command in ["xsel", "xclip"]:
if _copy_available(command):
return command



Carregando…
Cancelar
Salvar