* Don't try to display the GUI when running in textmode
* Updated textmode fix to always run the GUI under Windows
pthread_mutex_init(&print_lock, NULL);
#ifdef HAVE_GUI
+#ifdef _WIN32
InitGraphics(argc, argv, script_cmds_file, usb_present);
MainGraphics();
+#else
+ 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