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)