(Termux) Port new clipboard clear behavior to Termux

Former-commit-id: bdda7fae8c2305e1f64c468d45c205d12645f669
Former-commit-id: e6fea38cc85a03b8970f0cdf61390825cc048c20
This commit is contained in:
2023-09-26 19:32:56 -04:00
parent eb4fae3e9e
commit 2f6bdb8d2e
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -569,7 +569,8 @@ def copy_data():
# Termux (Android) clipboard detection
elif isdir("/data/data/com.termux"):
run(('termux-clipboard-set', _copy_subject))
Popen("sleep 30; termux-clipboard-set ''", shell=True)
Popen(f"sleep 30; test \'{_hash.hexdigest() + 2 * ' ' + '-'}\' = \"$(printf \"$(termux-clipboard-get)\" | "
f"sha512sum)\" && termux-clipboard-set ''", shell=True)
# X11 clipboard detection
elif 'DISPLAY' in environ:
run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\')
+2 -1
View File
@@ -22,7 +22,8 @@ if len(arguments) > 0:
Popen('sleep 30; clipboard -r', shell=True)"""
elif arguments[0] == 'TERMUX':
replacement = """run(('termux-clipboard-set', _copy_subject))
Popen("sleep 30; termux-clipboard-set ''", shell=True)"""
Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2 * ' ' + '-'}\\' = \\"$(printf \\"$(termux-clipboard-get)\\" | "
f"sha512sum)\\" && termux-clipboard-set ''", shell=True)"""
elif arguments[0] == 'LINUX':
replacement = """if 'WAYLAND_DISPLAY' in environ:
run('wl-copy', stdin=Popen(('printf', _copy_subject