Added WSL clipboard support

Former-commit-id: 0d365e6ec00549a9578e7adc4330a89cc8b5dabd
Former-commit-id: 8a3fe31f06f92e4298dd21521b84500f3ca48734
This commit is contained in:
2023-04-03 20:41:28 -04:00
parent d9873df2d1
commit 154905792a
+4 -1
View File
@@ -697,7 +697,10 @@ def copy_data(): # copies a specified field of an entry to the clipboard
_index = 2
elif arguments[2] in ('note', '-n'):
_index = 3
if 'WAYLAND_DISPLAY' in environ: # Wayland clipboard detection
if 'WSL_DISTRO_NAME' in environ: # WSL clipboard detection
run(['pwsh.exe', '-c', 'Set-Clipboard', _copy_line[_index].rstrip()])
Popen("sleep 30; pwsh.exe -c 'echo \"\" | Set-Clipboard'", shell=True)
elif '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