You need to write a shell script that runs commands to display the gui, and then execute the command.