ersiner / osx-env-sync Goto Github PK
View Code? Open in Web Editor NEWSynchronize OS X environment variables for command line and GUI applications from a single source
License: Apache License 2.0
Synchronize OS X environment variables for command line and GUI applications from a single source
License: Apache License 2.0
My ~/.bash_profile just has one line: source .bashrc
. For now I've just changed .osx-env-sync.sh to read from that file, but that's obviously not ideal. Would be cool if we could follow the chain of source
calls. I could imagine some people splitting up their bashrc into several files based on area of concern, for instance.
I have just discovered that this launchctl item is run after any programs that were restarted automatically because they were running at last logout or shutdown and restart items was selected. Therefore they do not see the intended environment.
Anyone know of a way to make this run before those items or an alternative that will run first?
It looks like since many functions in launchctl were deprecated this approach does not work.
cat ~/Library/LaunchAgents/environment.plist
envsync local.envsync ProgramArguments sh -c launchctl setenv foo "bar" RunAtLoadlaunchctl load ~/Library/LaunchAgents/environment.plist
/Users/.../Library/LaunchAgents/environment.plist: Operation not permitted
launchctl setenv foo "bar"
Not privileged to set domain environment.
load is apparently now a "Legacy Subcommand". The setenv subcommand also has issues.
I don't currently need any of these in applications, so not a big deal, but worth noting:
export PS1='some stuff'
doesn't work
export HISTFILESIZE=
doesn't work
export HISTFILESIZE=""
doesn't work
This is a note to hopefully help others.
I found that osx-env-sync was not working on Big Sur. After investigation I discovered that the launch agent was no longer in ~/Library/LaunchAgents
. I copied it there using the curl command given in README.md and it works again. I don't know when the launch agent was removed except that I did not do it. It is possible it was removed when I installed Catalina as I haven't needed sync'ing for a while.
In case anybody needs it: https://gist.github.com/earwin/1f722d8f4bcf1ea3d3fa72a468f87a0a
Compared to original:
(ruby snippet borrowed from https://github.com/mexisme/osx-env-sync)
export MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
doesn't work.
launchctl getenv MAVEN_OPTS
output is nothing.
I found this project refered from https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x/3756686#32405815
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.