Detect Wayland sessions by checking if $WAYLAND_DISPLAY is set

Former-commit-id: 584427e2b5f0d8a1cad1c1fa30b5024d976b9a14 [formerly d7987a1bc0]
Former-commit-id: c79d54b2d7fb8ff2f1283c388ad5aa1c16a7dcd1
This commit is contained in:
2022-12-04 17:45:50 -05:00
parent 5f903966da
commit 5bec4fdaa9
+1 -1
View File
@@ -773,7 +773,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
_index = 2
elif argument_list[2] == 'note' or argument_list[2] == '-n':
_index = 3
if environ.get('XDG_SESSION_TYPE') == 'wayland': # Wayland clipboard detection
if 'WAYLAND_DISPLAY' in environ: # Wayland clipboard detection
run(['wl-copy', _copy_line[_index].rstrip()])
Popen('sleep 30; wl-copy -c', shell=True)
elif uname()[0] == 'Haiku': # Haiku clipboard detection