replacing useGUI flag with getenv("DISPLAY")