From 551f1e8f50437ab5c9a5f9c21e5430b7c7f3beed Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 16 May 2022 00:16:45 -0400 Subject: [PATCH] Reduce clipboard timeout to 30 seconds --- bin/sshyp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/sshyp b/bin/sshyp index 6647c95..957cd20 100755 --- a/bin/sshyp +++ b/bin/sshyp @@ -522,7 +522,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard system('clipboard -c ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'") elif argument.startswith('copy note') or argument.startswith('copy -n'): system('clipboard -c ' + "'" + _copy_line[4].replace('\n', '').replace("'", "'\\''") + "'") - _clear_command = 'sleep 45; clipboard -r' + _clear_command = 'sleep 30; clipboard -r' elif Path("/data/data/com.termux").exists(): # Termux (Android) clipboard detection if argument.startswith('copy username') or argument.startswith('copy -u'): system('termux-clipboard-set ' + "'" + _copy_line[0].replace('\n', '').replace("'", "'\\''") + "'") @@ -532,7 +532,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard system('termux-clipboard-set ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'") elif argument.startswith('copy note') or argument.startswith('copy -n'): system('termux-clipboard-set ' + "'" + _copy_line[4].replace('\n', '').replace("'", "'\\''") + "'") - _clear_command = "sleep 45; termux-clipboard-set ''" + _clear_command = "sleep 30; termux-clipboard-set ''" elif environ.get('WAYLAND_DISPLAY') == 'wayland-0': # Wayland clipboard detection if argument.startswith('copy username') or argument.startswith('copy -u'): system('wl-copy ' + "'" + _copy_line[0].replace('\n', '').replace("'", "'\\''") + "'") @@ -542,7 +542,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard system('wl-copy ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'") elif argument.startswith('copy note') or argument.startswith('copy -n'): system('wl-copy ' + "'" + _copy_line[4].replace('\n', '').replace("'", "'\\''") + "'") - _clear_command = 'sleep 45; wl-copy -c' + _clear_command = 'sleep 30; wl-copy -c' else: # X11 clipboard detection if argument.startswith('copy username') or argument.startswith('copy -u'): system('echo -n ' + "'" + _copy_line[0].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c') @@ -552,7 +552,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard system('echo -n ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c') elif argument.startswith('copy note') or argument.startswith('copy -n'): system('echo -n ' + "'" + _copy_line[4].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c') - _clear_command = "sleep 45; echo -n '' | xclip -sel c" + _clear_command = "sleep 30; echo -n '' | xclip -sel c" Popen(_clear_command, shell=True) rmtree(f"{tmp_dir}{_shm_folder}")