mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-05 16:47:14 -04:00
Initial MacOS support (no packaging)
Former-commit-id: 835ed80a9da57a7a40e6463f0ee822c900248e05 Former-commit-id: a3db3fbf88e8a8bcc485821a31ea4f3862a4abbf
This commit is contained in:
+4
-1
@@ -206,7 +206,7 @@ def tweak(): # runs configuration wizard
|
|||||||
# config directory creation
|
# config directory creation
|
||||||
Path(f"{home}/.config/sshyp/devices").mkdir(mode=0o700, parents=True, exist_ok=True)
|
Path(f"{home}/.config/sshyp/devices").mkdir(mode=0o700, parents=True, exist_ok=True)
|
||||||
if not exists(f"{home}/.config/sshyp/tmp"):
|
if not exists(f"{home}/.config/sshyp/tmp"):
|
||||||
if uname()[0] in ('Haiku', 'FreeBSD'):
|
if uname()[0] in ('Haiku', 'FreeBSD', 'Darwin'):
|
||||||
symlink('/tmp', f"{home}/.config/sshyp/tmp")
|
symlink('/tmp', f"{home}/.config/sshyp/tmp")
|
||||||
elif exists('/data/data/com.termux'):
|
elif exists('/data/data/com.termux'):
|
||||||
symlink('/data/data/com.termux/files/usr/tmp', f"{home}/.config/sshyp/tmp")
|
symlink('/data/data/com.termux/files/usr/tmp', f"{home}/.config/sshyp/tmp")
|
||||||
@@ -706,6 +706,9 @@ def copy_data(): # copies a specified field of an entry to the clipboard
|
|||||||
elif uname()[0] == 'Haiku': # Haiku clipboard detection
|
elif uname()[0] == 'Haiku': # Haiku clipboard detection
|
||||||
run(['clipboard', '-c', _copy_line[_index].rstrip()])
|
run(['clipboard', '-c', _copy_line[_index].rstrip()])
|
||||||
Popen('sleep 30; clipboard -r', shell=True)
|
Popen('sleep 30; clipboard -r', shell=True)
|
||||||
|
elif uname()[0] == 'Darwin': # MacOS clipboard detection
|
||||||
|
run(['pbcopy'], stdin=Popen(['printf', _copy_line[_index].rstrip()], stdout=PIPE).stdout)
|
||||||
|
Popen("sleep 30; printf '' | pbcopy", shell=True)
|
||||||
elif exists("/data/data/com.termux"): # Termux (Android) clipboard detection
|
elif exists("/data/data/com.termux"): # Termux (Android) clipboard detection
|
||||||
run(['termux-clipboard-set', _copy_line[_index].rstrip()])
|
run(['termux-clipboard-set', _copy_line[_index].rstrip()])
|
||||||
Popen("sleep 30; termux-clipboard-set ''", shell=True)
|
Popen("sleep 30; termux-clipboard-set ''", shell=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user