‘config’ is a subcommand of ‘launchctl’.

Not having a common PATH for command-line and Finder execution is right royal 
pain, as I found many years ago. So way back when, I set up my 
environment.plist then, when Apple invalidated that, my launchctl environment, 
and I had forgotten about the problems of persisting the environment changes. 
The way I actually do it involves collecting all of the launchctl commands to a 
file, and executing each of them on login, via a simple LaunchAgent script.

Details are at 
http://www.pbw.id.au/blog/2013/11/setting-environment-variables-in-os-x-yosemite-and-mavericks/
 
<http://www.pbw.id.au/blog/2013/11/setting-environment-variables-in-os-x-yosemite-and-mavericks/>

If anyone wants a hand with this, let me know.

—
Peter West
[email protected]
“And if anyone forces you to go one mile, go with him two miles.”

> On 14 Jun 2021, at 2:43 am, John Ralls <[email protected]> wrote:
> 
> https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications
>  
> <https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications>
>  has some details about using launchctl. It seems to be a bit fiddly and with 
> setenv you have to run the command *once* after every reboot, meaning that 
> after you boot you login, open a Terminal session, run `launchctl setenv...`, 
> and kill the Dock. After that you can run GnuCash from Finder and it will use 
> the changed path, though the SO indicates that it works only on 10.7.
> 
> On newer versions of macOS there's `config` command that you run just once 
> then reboot, but it's not clear from the SO nor from launchctl(1) with what 
> version that was introduced; 10.12 is the earliest mentioned in the SO. Since 
> it's persistent make sure that you know how to undo it if you don't like the 
> results... if you screw it up badly enough that might mean booting to single 
> user. Definitely for experts only.
> 
> Regards,
> John Ralls
> 
> 
>> On Jun 13, 2021, at 2:01 AM, Peter West <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> I think it is still true for Big Sur that the launchctl environment for Mac 
>> can be set with launchctl commands.
>> 
>> To set the same env var in  the launchctl environment as in your .profile 
>> environment, you can include in your .profile a function like this:
>> 
>> set_env_var () {
>>   eval export $1=\""$2"\"
>>   eval launchctl setenv "$1" \""$2"\"
>> }
>> 
>> Instead of
>> export PATH=blah
>> use
>> set_env_var PATH “blah”
>> 
>> I not sure about the timing of environment settings; that is, whether you 
>> can start up a shell and then immediately invoke, say, GnuCash, or whether 
>> you must log out and in to have the env vars in effect.
>> 
>> 
>> —
>> Peter West
>> [email protected]
>> “…whoever says, ‘You fool!’ will be liable to the hell of fire.”
>> 
>> 
>> 
>>> On 13 Jun 2021, at 6:23 pm, Liz Dodd <[email protected]> wrote:
>>> 
>>> On Sun, 13 Jun 2021 00:39:39 -0700
>>> Jim DeLaHunt <[email protected] <mailto:[email protected]> 
>>> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>>> 
>>>> GnuCash ships with Helper Scripts  which make it easier to work with 
>>>> Finance::Quote. They are: gnc-fq-check, gnc-fq-dump, gnc-fq-helper,
>>>> and gnc-fq-update. Collectively, call them gc-fq-* .
>>>> 
>>>> When running these Helper Scripts from a command prompt on MacOS and 
>>>> Linux, should they invoked as commands:
>>>> 
>>>> % gnc-fq-check
>>>> 
>>>> Or should they be invoked as an argument to a perl command:
>>>> 
>>>> % perl gnc-fq-check
>>>> 
>>>> ?
>>>> 
>>>> The wiki page
>>>> https://wiki.gnucash.org/wiki/Online_Quotes#Helper_Scripts says,
>>>> pretty clearly, the former:
>>>> 
>>>> "While unixoid operating systems use a shebang (#!) to associate perl 
>>>> scripts with the Perl interpreter, others, e.g. Windows, will fail….
>>>> C:\> gnc-fq-check [fails]…  
>>>> so use the following: … Prefix any gnc-fq-xxx perl script command
>>>> with perl and a space: …
>>>> perl gnc-fq-check …"
>>>> 
>>>> The perl invocation is described as a workaround needed on Windows 
>>>> because the shebang doesn't work. All the other examples show
>>>> invocation as a command, e.g.
>>>> 
>>>> $ gnc-fq-check
>>>> 
>>>> This makes a difference on Unixoid systems when there are multiple
>>>> Perl installations. Presumably command invocation of the helper
>>>> scripts will always obey the shebang and thus always run the same
>>>> Perl installation. But invocation as an argument to "perl" will run
>>>> whichever Perl installation the environment dictates.
>>>> 
>>>> Am I correct in guessing that GnuCash 4.5 internally invokes these 
>>>> scripts (maybe just gnc-fq-helper) as an argument to a perl command?
>>>> 
>>>> If so, should the wiki page
>>>> https://wiki.gnucash.org/wiki/Online_Quotes use the same invocation?
>>>> 
>>>> Best regards,
>>>>    —Jim DeLaHunt
>>>> 
>>> 
>>> I don't know the answer, but I think that if you could write it out for
>>> the wiki it would be good long term recording.
>>> 
>>> Liz
>>> _______________________________________________
>>> gnucash-user mailing list
>>> [email protected]
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>> If you are using Nabble or Gmane, please see 
>>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>> -----
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>> 
>> _______________________________________________
>> gnucash-user mailing list
>> [email protected] <mailto:[email protected]>
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user 
>> <https://lists.gnucash.org/mailman/listinfo/gnucash-user>
>> If you are using Nabble or Gmane, please see 
>> https://wiki.gnucash.org/wiki/Mailing_Lists 
>> <https://wiki.gnucash.org/wiki/Mailing_Lists> for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
[email protected]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to