Don't try to display the GUI when running in textmode

This commit is contained in:
LW 2017-08-26 16:31:04 -07:00
commit 3414ec8027

View file

@ -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