]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/__init__.py
Add first-launch command
[waydroid.git] / tools / __init__.py
index 2443e6ebb5d6a7a5c2f580bdbca6288094fe5896..df427524901becd9d281269006948f4df45611e6 100644 (file)
@@ -5,6 +5,7 @@ import sys
 import logging
 import os
 import traceback
 import logging
 import os
 import traceback
+import subprocess
 
 from . import actions
 from . import config
 
 from . import actions
 from . import config
@@ -32,7 +33,7 @@ def main():
         args.timeout = 1800
 
         if not actions.initializer.is_initialized(args):
         args.timeout = 1800
 
         if not actions.initializer.is_initialized(args):
-            if args.action and (args.action != "init" and args.action != "log"):
+            if args.action and (args.action not in ("init", "first-launch", "log")):
                 if not args.wait_for_init:
                     print('ERROR: WayDroid is not initialized, run "waydroid init"')
                     return 0
                 if not args.wait_for_init:
                     print('ERROR: WayDroid is not initialized, run "waydroid init"')
                     return 0
@@ -116,6 +117,10 @@ def main():
             helpers.lxc.logcat(args)
         elif args.action == "show-full-ui":
             actions.app_manager.showFullUI(args)
             helpers.lxc.logcat(args)
         elif args.action == "show-full-ui":
             actions.app_manager.showFullUI(args)
+        elif args.action == "first-launch":
+            subprocess.run(["pkexec", sys.argv[0], "init", "--gui"])
+            if actions.initializer.is_initialized(args):
+                actions.app_manager.showFullUI(args)
         elif args.action == "status":
             actions.status.print_status(args)
         elif args.action == "log":
         elif args.action == "status":
             actions.status.print_status(args)
         elif args.action == "log":