mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-01 06:46:30 -04:00
Initial addition of #20 (ports framework), clipboard port-job
Former-commit-id: 2b6a931b1ae67e645a1f5dbf1b7ce51cf7c837ba Former-commit-id: 04fffa7119d954f2c4cf41fdac01782306d888de
This commit is contained in:
@@ -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}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user