mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-31 06:16:29 -04:00
(Termux) Port new clipboard clear behavior to Termux
Former-commit-id: bdda7fae8c2305e1f64c468d45c205d12645f669 Former-commit-id: e6fea38cc85a03b8970f0cdf61390825cc048c20
This commit is contained in:
+2
-1
@@ -569,7 +569,8 @@ def copy_data():
|
|||||||
# Termux (Android) clipboard detection
|
# Termux (Android) clipboard detection
|
||||||
elif isdir("/data/data/com.termux"):
|
elif isdir("/data/data/com.termux"):
|
||||||
run(('termux-clipboard-set', _copy_subject))
|
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
|
# X11 clipboard detection
|
||||||
elif 'DISPLAY' in environ:
|
elif 'DISPLAY' in environ:
|
||||||
run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\')
|
run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\')
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ if len(arguments) > 0:
|
|||||||
Popen('sleep 30; clipboard -r', shell=True)"""
|
Popen('sleep 30; clipboard -r', shell=True)"""
|
||||||
elif arguments[0] == 'TERMUX':
|
elif arguments[0] == 'TERMUX':
|
||||||
replacement = """run(('termux-clipboard-set', _copy_subject))
|
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':
|
elif arguments[0] == 'LINUX':
|
||||||
replacement = """if 'WAYLAND_DISPLAY' in environ:
|
replacement = """if 'WAYLAND_DISPLAY' in environ:
|
||||||
run('wl-copy', stdin=Popen(('printf', _copy_subject
|
run('wl-copy', stdin=Popen(('printf', _copy_subject
|
||||||
|
|||||||
Reference in New Issue
Block a user