(Haiku) Port new clipboard behavior to Haiku

Former-commit-id: 3a40559cf39475a0291187a4853c1e5f335b96f0
Former-commit-id: 95bfec78129d9d22afb16a33775df8d3abb24fa1
This commit is contained in:
2023-09-26 19:51:05 -04:00
parent 2f6bdb8d2e
commit 20cdc27b88
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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)
+2 -1
View File
@@ -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)\\" | "