How do I run a gui app from the command line?

nickponline

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!

animaletdesequia

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I run a gui app from the command line?

From Dev

How do I run a LibreOffice macro from the command line without the GUI?

From Dev

How do I open a WinSCP GUI session from command line?

From Dev

How do I open a WinSCP GUI session from command line?

From Dev

How do I run a Cocoa app after building it from the command line with xcodebuild?

From Dev

How do I run this script with sudo from the command-line?

From Dev

How do I run .c file from the command line

From Dev

How can I run app tests that use Google App Engine PHP SDK functions from the command line

From Dev

How do I boot to a command line interface instead of a GUI?

From Dev

How do I boot to a command line interface instead of a GUI?

From Dev

Run SAS from command line without GUI

From Dev

How do I redirect output from a command line app (howie AIML interpreter) to another command line app (espeak)?

From Dev

How can I start octave from the command line and not the GUI?

From Dev

How to I manage Azure "files" from GUI and command line?

From Dev

When I run an app from the cmd-line, how do I find the exe's path?

From Dev

How do I remove app from iOS 8 Simulator from command line?

From Dev

How do I run xctest from the command-line with Xcode 5?

From Dev

How do I run a javascript within html from the command line and include arguments?

From Dev

How do I run dcm4che tools from command line after compilation?

From Dev

How do I run a Metro-Application from the command-line in Windows 8?

From Dev

How do I run an argument from a program in the windows command-line?

From Dev

How do I run IIS Express from the command line with "Enabled 32 bit applications" enabled?

From Dev

How do I run a command in bash from zsh (or some other shell) in one line?

From Java

How to run .NET Core console app from the command line

From Dev

How do I get the command-line for an Eclipse run configuration?

From Dev

How do I get the command-line for an Eclipse run configuration?

From Dev

How do I run a for loop on the command line as root in bash

From Dev

How do you run tests from the command line?

From Dev

How do you set up gsutil to be run from the command line

Related Related

  1. 1

    How do I run a gui app from the command line?

  2. 2

    How do I run a LibreOffice macro from the command line without the GUI?

  3. 3

    How do I open a WinSCP GUI session from command line?

  4. 4

    How do I open a WinSCP GUI session from command line?

  5. 5

    How do I run a Cocoa app after building it from the command line with xcodebuild?

  6. 6

    How do I run this script with sudo from the command-line?

  7. 7

    How do I run .c file from the command line

  8. 8

    How can I run app tests that use Google App Engine PHP SDK functions from the command line

  9. 9

    How do I boot to a command line interface instead of a GUI?

  10. 10

    How do I boot to a command line interface instead of a GUI?

  11. 11

    Run SAS from command line without GUI

  12. 12

    How do I redirect output from a command line app (howie AIML interpreter) to another command line app (espeak)?

  13. 13

    How can I start octave from the command line and not the GUI?

  14. 14

    How to I manage Azure "files" from GUI and command line?

  15. 15

    When I run an app from the cmd-line, how do I find the exe's path?

  16. 16

    How do I remove app from iOS 8 Simulator from command line?

  17. 17

    How do I run xctest from the command-line with Xcode 5?

  18. 18

    How do I run a javascript within html from the command line and include arguments?

  19. 19

    How do I run dcm4che tools from command line after compilation?

  20. 20

    How do I run a Metro-Application from the command-line in Windows 8?

  21. 21

    How do I run an argument from a program in the windows command-line?

  22. 22

    How do I run IIS Express from the command line with "Enabled 32 bit applications" enabled?

  23. 23

    How do I run a command in bash from zsh (or some other shell) in one line?

  24. 24

    How to run .NET Core console app from the command line

  25. 25

    How do I get the command-line for an Eclipse run configuration?

  26. 26

    How do I get the command-line for an Eclipse run configuration?

  27. 27

    How do I run a for loop on the command line as root in bash

  28. 28

    How do you run tests from the command line?

  29. 29

    How do you set up gsutil to be run from the command line

HotTag

Archive