Clear X11 clipboard with 'printf', rather than the less standard 'echo -n'

Former-commit-id: d6f994d9b0edd9aa333dcb76c34a15c26a3631b2
Former-commit-id: ad5858bbdcafec5be890e801938a0fb8f6df8a9c
This commit is contained in:
2023-04-03 20:57:34 -04:00
parent 154905792a
commit 478d10384f
+2 -2
View File
@@ -710,8 +710,8 @@ def copy_data(): # copies a specified field of an entry to the clipboard
run(['termux-clipboard-set', _copy_line[_index].rstrip()])
Popen("sleep 30; termux-clipboard-set ''", shell=True)
else: # X11 clipboard detection
run(['xclip', '-sel', 'c'], stdin=Popen(['echo', '-n', _copy_line[_index].rstrip()], stdout=PIPE).stdout)
Popen("sleep 30; echo -n '' | xclip -sel c", shell=True)
run(['xclip', '-sel', 'c'], stdin=Popen(['printf', _copy_line[_index].rstrip()], stdout=PIPE).stdout)
Popen("sleep 30; printf '' | xclip -sel c", shell=True)
rmtree(f"{tmp_dir}{_shm_folder}")