diff --git a/lib/sshyp.py b/lib/sshyp.py index 31886c8..b44e6ee 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -560,7 +560,8 @@ def copy_data(): # Haiku clipboard detection elif uname()[0] == 'Haiku': run(('clipboard', '-c', _copy_subject)) - Popen('sleep 30; clipboard -r', shell=True) + Popen(f"sleep 30; test \'{_hash.hexdigest() + 2 * ' ' + '-'}\' = \"$(printf \"$(clipboard -p)\" | sha512sum)\" " + "&& clipboard -r", shell=True) # MacOS clipboard detection elif uname()[0] == 'Darwin': run('pbcopy', stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\').replace('%', '%%')), stdout=PIPE) diff --git a/port-jobs/CLIPBOARD.py b/port-jobs/CLIPBOARD.py index c3f5503..e92b6de 100755 --- a/port-jobs/CLIPBOARD.py +++ b/port-jobs/CLIPBOARD.py @@ -19,7 +19,8 @@ if len(arguments) > 0: Popen("sleep 30; printf '' | pbcopy", shell=True)""" elif arguments[0] == 'HAIKU': replacement = """run(('clipboard', '-c', _copy_subject)) - Popen('sleep 30; clipboard -r', shell=True)""" + Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2 * ' ' + '-'}\\' = \\"$(printf \\"$(clipboard -p)\\" | sha512sum)\\" " + "&& clipboard -r", shell=True)""" elif arguments[0] == 'TERMUX': replacement = """run(('termux-clipboard-set', _copy_subject)) Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2 * ' ' + '-'}\\' = \\"$(printf \\"$(termux-clipboard-get)\\" | "