diff --git a/client/proxmark3.c b/client/proxmark3.c index b10385383..7b80da0b6 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -306,8 +306,21 @@ int main(int argc, char* argv[]) { pthread_mutex_init(&print_lock, NULL); #ifdef HAVE_GUI + +# if _WIN32 InitGraphics(argc, argv, script_cmds_file, usb_present); MainGraphics(); +# else + // for *nix distro's, check enviroment variable to verify a display + 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); + } +# endif + #else main_loop(script_cmds_file, usb_present); #endif