From aa0bd017c9bdd9666eeca4e23e9a8e2a640cab1a Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 24 Sep 2023 22:04:00 -0400 Subject: [PATCH] Fixed CLIPBOARD.py port-job overriding the new clipboard clear behavior Former-commit-id: 13f705945bf0bbe95b5699f2bd64b9c790324048 Former-commit-id: 54e8c6f8d54e592bdda885de296f56f1d5ecdd24 --- lib/sshyp.py | 2 +- port-jobs/CLIPBOARD.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index db37719..d9a79a6 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -542,7 +542,7 @@ def copy_data(): # store hashed _copy_subject for later comparison _hash = sha512() _hash.update(_copy_subject.encode('utf-8')) - _hash = _hash.hexdigest() + ' -' + _hash = _hash.hexdigest() + f"{2*' '}-" # PORT START CLIPBOARD # WSL clipboard detection diff --git a/port-jobs/CLIPBOARD.py b/port-jobs/CLIPBOARD.py index 43f4540..90867d7 100755 --- a/port-jobs/CLIPBOARD.py +++ b/port-jobs/CLIPBOARD.py @@ -24,7 +24,7 @@ if len(arguments) > 0: replacement = """if 'WAYLAND_DISPLAY' in environ: run('wl-copy', stdin=Popen(('printf', _copy_subject .replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')), stdout=PIPE).stdout) - Popen('sleep 30; wl-copy -c', shell=True) + Popen(f"sleep 30; test \\'{_hash}\\' = \\"$(printf \\"$(wl-paste)\\" | sha512sum)\\" && wl-copy -c", shell=True) else: run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject .replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')), stdout=PIPE).stdout)