Implement 'auto-start in GUI' feature
authorAlexander Vasarab <alexander@wylark.com>
Thu, 9 Jul 2020 21:22:15 +0000 (14:22 -0700)
committerAlexander Vasarab <alexander@wylark.com>
Thu, 9 Jul 2020 21:22:15 +0000 (14:22 -0700)
munter/munter.py

index 8efe665a5f9bb93ef9e7c0d644952a0c870703f4..062e6769edd12ac0556435aaace0d5186b35afe7 100644 (file)
@@ -183,6 +183,10 @@ def main():
                               fitness=fitness, rate=travel_mode,
                               units=units)
 
+    # auto-start in GUI mode if the program is not invoked from terminal
+    if len(sys.argv) == 1 and not sys.stdin.isatty():
+        gui = True
+
     if gui:
         from . import gui
         gui.startup()