summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2023-12-11 16:29:02 -0500
committerJohn Kacur <jkacur@redhat.com>2023-12-11 16:30:44 -0500
commitf2763aaed8f421bcf266a3122a84c41a7441a5d9 (patch)
tree069c74a926fe6f0c261e7c1e3fc32f50698da391
parentf72146c1548c08ccd1135323355941dc6bece81e (diff)
downloadtuna-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-xtuna-cmd.py6
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: