Initial addition of #20 (ports framework), clipboard port-job

Former-commit-id: 2b6a931b1ae67e645a1f5dbf1b7ce51cf7c837ba
Former-commit-id: 04fffa7119d954f2c4cf41fdac01782306d888de
This commit is contained in:
2023-04-12 22:37:36 -04:00
parent 9063d02cf1
commit da3938e80b
3 changed files with 132 additions and 32 deletions
+2
View File
@@ -697,6 +697,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
_index = 2
elif arguments[2] in ('note', '-n'):
_index = 3
# PORT START CLIPBOARD
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)
@@ -717,6 +718,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
run(['xclip', '-sel', 'c'], stdin=Popen(['printf', _copy_line[_index].rstrip().replace('\\', '\\\\')
.replace('%', '%%')], stdout=PIPE).stdout)
Popen("sleep 30; printf '' | xclip -sel c", shell=True)
# PORT END CLIPBOARD
rmtree(f"{tmp_dir}{_shm_folder}")