try to execute the application with sudo -E applicationName this command will keep the current environment variables associated with graphics to run a Gui Application in linux desktop
sudo -E applicationName