> On May 20, 2015, at 3:14 PM, Carl Hoefs <[email protected]>
> wrote:
>
> From a bash script I launch an app, but I only want this behavior if the user
> is locally logged in at the console. If the user has ssh’d into the machine
> and is running the bash script, the app launch should not be attempted (it
> will fail since the user doesn’t ‘own’ the screen).
What is the trigger event for your script? If it is login, then you can
just use the launch-agent part of launchd to make this distinction. The
`LimitLoadToSessionType` key take “Aqua” and “StandardIO” to differentiate
between GUI and non-GUI (e.g.: ssh) sessions. There are also “Background” that
apply to all types of logins, and "LoginWindow” that only runs in that context.
—
Karl Kuehn
[email protected]
_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk