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