mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-01 14:47:17 -04:00
(MacOS) Port new clipboard behavior to MacOS
Former-commit-id: bd887c5ee6a75130b8c994034708ae7893764251 Former-commit-id: e1621ed1a986f731c8217d741fd84a42196cb4e9
This commit is contained in:
+2
-1
@@ -566,7 +566,8 @@ def copy_data():
|
||||
elif uname()[0] == 'Darwin':
|
||||
run('pbcopy', stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\').replace('%', '%%')), stdout=PIPE)
|
||||
.stdout)
|
||||
Popen("sleep 30; printf '' | pbcopy", shell=True)
|
||||
Popen(f"sleep 30; test \'{_hash.hexdigest() + 2 * ' ' + '-'}\' = \"$(printf \"$(pbpaste)\" | shasum -a 512)\" "
|
||||
"&& printf '' | pbcopy", shell=True)
|
||||
# Termux (Android) clipboard detection
|
||||
elif isdir("/data/data/com.termux"):
|
||||
run(('termux-clipboard-set', _copy_subject))
|
||||
|
||||
@@ -16,7 +16,8 @@ if len(arguments) > 0:
|
||||
elif arguments[0] == 'MAC':
|
||||
replacement = """run('pbcopy', stdin=Popen(('printf', _copy_subject.replace('\\\\\\', '\\\\\\\\\\\\\\')
|
||||
.replace('%', '%%')), stdout=PIPE).stdout)
|
||||
Popen("sleep 30; printf '' | pbcopy", shell=True)"""
|
||||
Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2 * ' ' + '-'}\\' = \\"$(printf \\"$(pbpaste)\\" | shasum -a 512)\\" "
|
||||
"&& printf '' | pbcopy", shell=True)"""
|
||||
elif arguments[0] == 'HAIKU':
|
||||
replacement = """run(('clipboard', '-c', _copy_subject))
|
||||
Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2 * ' ' + '-'}\\' = \\"$(printf \\"$(clipboard -p)\\" | sha512sum)\\" "
|
||||
|
||||
Reference in New Issue
Block a user