diff options
author | John Kacur <jkacur@redhat.com> | 2023-12-11 16:29:02 -0500 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2023-12-11 16:30:44 -0500 |
commit | f2763aaed8f421bcf266a3122a84c41a7441a5d9 (patch) | |
tree | 069c74a926fe6f0c261e7c1e3fc32f50698da391 | |
parent | f72146c1548c08ccd1135323355941dc6bece81e (diff) | |
download | tuna-getopt.tar.gz |
tuna: Don't start the gui if a display is not availablegetopt
This is intended for the getopt branch of tuna
Don't start the gui if a display is not available.
Signed-off-by: John Kacur <jkacur@redhat.com>
-rwxr-xr-x | tuna-cmd.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tuna-cmd.py b/tuna-cmd.py index 38e7017..ff2920f 100755 --- a/tuna-cmd.py +++ b/tuna-cmd.py @@ -821,6 +821,12 @@ def main(): sys.exit(2) if run_gui: + # Don't try to start the gui if no display is available + display = os.getenv("DISPLAY") + if not display: + usage() + return + try: from tuna import tuna_gui except ImportError: |