mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -04:00
(X11) Port new clipboard clear behavior to X11
Former-commit-id: 11edd45f8ccaa6de548d6656ef50cd0c1bdff0b4 Former-commit-id: 1fb779b6d27937d83802f50fb6857f24ec7765ed
This commit is contained in:
+3
-2
@@ -556,7 +556,7 @@ def copy_data():
|
||||
run('wl-copy', stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\').replace('%', '%%')),
|
||||
stdout=PIPE).stdout)
|
||||
Popen(f"sleep 30; test \'{_hash.hexdigest() + 2*' ' + '-'}\' = \"$(printf \"$(wl-paste)\" | sha512sum)\" "
|
||||
"&& wl-copy -c", shell=True)
|
||||
"&& wl-copy -c", shell=True)
|
||||
# Haiku clipboard detection
|
||||
elif uname()[0] == 'Haiku':
|
||||
run(('clipboard', '-c', _copy_subject))
|
||||
@@ -574,7 +574,8 @@ def copy_data():
|
||||
elif 'DISPLAY' in environ:
|
||||
run(('xclip', '-se', 'c'), stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\')
|
||||
.replace('%', '%%')), stdout=PIPE).stdout)
|
||||
Popen("sleep 30; printf '' | xclip -se c", shell=True)
|
||||
Popen(f"sleep 30; test \'{_hash.hexdigest() + 2*' ' + '-'}\' = \"$(printf \"$(xclip -o -se c)\" | sha512sum)\" "
|
||||
"&& xclip -i /dev/null -se c", shell=True)
|
||||
else:
|
||||
print('\n\u001b[38;5;9merror: clipboard tool could not be determined\n\nnote that the clipboard does not '
|
||||
'function in a raw tty\u001b[0m\n')
|
||||
|
||||
@@ -28,11 +28,12 @@ if len(arguments) > 0:
|
||||
run('wl-copy', stdin=Popen(('printf', _copy_subject
|
||||
.replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')), stdout=PIPE).stdout)
|
||||
Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2*' ' + '-'}\\' = \\"$(printf \\"$(wl-paste)\\" | sha512sum)\\" "
|
||||
"&& wl-copy -c", shell=True)
|
||||
"&& wl-copy -c", shell=True)
|
||||
else:
|
||||
run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject
|
||||
run(('xclip', '-se', 'c'), stdin=Popen(('printf', _copy_subject
|
||||
.replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')), stdout=PIPE).stdout)
|
||||
Popen("sleep 30; printf '' | xclip -sel c", shell=True)"""
|
||||
Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2*' ' + '-'}\\' = \\"$(printf \\"$(xclip -o -se c)\\" | sha512sum)\\" "
|
||||
"&& xclip -i /dev/null -se c", shell=True)"""
|
||||
else:
|
||||
s_exit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user