mheily / jobd

A job management framework
Other
143 stars 15 forks source link

cannot launch graphical agents #33

Closed mheily closed 8 years ago

mheily commented 8 years ago

There is a problem launching graphical agents that I traced down to a lack of environment variables. Graphical programs need the DISPLAY variable to be passed through to them. It's probably a good idea to set the locale as well, and perhaps more things (HOME, maybe?)

Here's the workaround that I added to my job definition to get a graphical program to launch as an agent:

"EnvironmentVariables": {
    "DISPLAY": ":0.0",
    "LANG": "en_US.UTF-8",
    "LC_ALL": "en_US.UTF-8",
}

IMHO launchd should automatically set these environment variables for agents.

mheily commented 8 years ago

Here's a decent document describing some standard variables: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html