From 3414ec80274c66434400778d34e340ca9d2a6bf9 Mon Sep 17 00:00:00 2001 From: LW Date: Sat, 26 Aug 2017 16:31:04 -0700 Subject: [PATCH] Don't try to display the GUI when running in textmode --- client/proxmark3.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/client/proxmark3.c b/client/proxmark3.c index fa389dd1..374c0feb 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -274,8 +274,17 @@ int main(int argc, char* argv[]) { pthread_mutex_init(&print_lock, NULL); #ifdef HAVE_GUI - InitGraphics(argc, argv, script_cmds_file, usb_present); - MainGraphics(); + char* display = getenv("DISPLAY"); + + if (display && strlen(display) > 1) + { + InitGraphics(argc, argv, script_cmds_file, usb_present); + MainGraphics(); + } + else + { + main_loop(script_cmds_file, usb_present); + } #else main_loop(script_cmds_file, usb_present); #endif