From: Alexander Vasarab Date: Fri, 10 Jul 2020 17:42:46 +0000 (-0700) Subject: Merge branch 'release-2.3.0' X-Git-Tag: v2.3.0^0 X-Git-Url: https://wylark.com/src/munter.git/commitdiff_plain/refs/heads/master?hp=f6c31e69611050e412aaec1fefda844469a231cb Merge branch 'release-2.3.0' --- diff --git a/README.md b/README.md index d3b685d..37c92aa 100644 --- 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). diff --git a/munter/__init__.py b/munter/__init__.py index 7c45947..c38830a 100755 --- a/munter/__init__.py +++ b/munter/__init__.py @@ -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 diff --git a/munter/munter.py b/munter/munter.py index 8efe665..062e676 100644 --- a/munter/munter.py +++ b/munter/munter.py @@ -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()