Unable to use Local Display

howto

#1

I would like to open a browser window from a pack, however it can not open the display.

I am able to run the commands from a python script no issue.

I think the issue is that st2 is running as root. I have tried typical display commands, it still does not find the display.

I am running ubuntu 16.04


(Lindsay Hill) #2

Could you provide some examples of what sort of action you’re trying to run? I’m not quite following what you want to do.

Do you want to have an action that opens a browser on a user’s system?


#3

Sure, I need to open a browser on the local machine.

os.system(‘firefox’) or subprocess.call([‘firefox’])

Thanks!


(Lindsay Hill) #4

If you’re running that as a Python action, it will be running as root. You’ll need to explicitly tell it which display to connect to.

Also: this is probably not going to be a very good design pattern. Normally you run ST2 on a server system, not a desktop system


#5

I am aware this running as root, still could not get it to display.

FYI, this is a server with a desktop installed for usability.


(Lindsay Hill) #6

My guess will be that you’ll need to ensure that you’re passing it the right DISPLAY env var. you’ll also need to figure out the xauth settings.