Merge branch 'release-2.3.0' master v2.3.0
authorAlexander Vasarab <alexander@wylark.com>
Fri, 10 Jul 2020 17:42:46 +0000 (10:42 -0700)
committerAlexander Vasarab <alexander@wylark.com>
Fri, 10 Jul 2020 17:42:46 +0000 (10:42 -0700)
README.md
munter/__init__.py
munter/munter.py

index d3b685d2d94ccad196b5d92e59624a085d05cfae..37c92aa449712a11b8f0f69d45ff9016ab09596d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -68,6 +68,14 @@ Future plans
 Version History
 ---------------
 
+- 2.3.0 (Jul 2020)
+
+  Implement 'auto-start in GUI' feature.
+
+  The program tries to detect whether it was invoked from a terminal or
+  not, and if not, it will automatically switch to GUI mode. Useful for
+  invocation via e.g. dmenu(1).
+
 - 2.2.1 (Jun 2020)
 
   Complete fixes recommended by pylint(1).
index 7c459473f686574d4facf49cfba00955bcdc8229..c38830af32b3df4cfab7b46755e5023592471890 100755 (executable)
@@ -1,4 +1,4 @@
 """Main package for Munter.py"""
-__version__ = '2.2.1'
+__version__ = '2.3.0'
 __progname__ = 'Munter.py'
 from .munter import time_calc
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()