Add macos startup scripts

This commit is contained in:
Bernd Schoolmann 2024-06-01 14:32:25 +02:00
parent 275ba9a3d2
commit a41c91ca6b
No known key found for this signature in database
2 changed files with 23 additions and 2 deletions

View File

@ -1,4 +1,12 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import src.linux.main as linux_main
linux_main.main() import platform
if platform.system() == 'Darwin':
import src.macos.main as macos_main
macos_main.main()
elif platform.system() == 'Linux':
import src.linux.main as linux_main
linux_main.main()
else:
print("Unsupported OS " + platform.system() + "... exiting...")

13
gui/src/macos/main.py Normal file
View File

@ -0,0 +1,13 @@
import sys
import subprocess
import os
root_path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir))
def main():
token = "abc"
print("Starting Goldwarden GUI")
if not "--hidden" in sys.argv:
p = subprocess.Popen(["python3", "-m", "src.gui.settings"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=root_path, start_new_session=True)
p.stdin.write(f"{token}\n".encode())
p.stdin.flush()