I need to launch a GUI program from the command line on a machine I have SSH'd into. I don't need to interact with it or see the window, just have it running. When I try and launch it I get:
ubuntu@ip-35-163-23223429-46:~/photoscan-pro$ ./photoscan.sh
photoscan: cannot connect to X server
Is there anything I do? I'm on Ubuntu 12.04. Thanks!
Inside the script, before the application is launched, add this line:
export DISPLAY=:0.0
This tells the program that it has to run in the DISPLAY with ID :0.0 instead of the terminal where is being called,which (as far as I know) reffers to the TTY7.
In other words, sends it to the graphic environment. You can also use it locally, launching a program in the desktop from a virtual tty. I use it for instance when compiz crashes and there are no menus or icons to restart it:
export DISPLAY=:0.0 && compiz --replace
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments