3 ms·
First off, I hadn't run into Hammerspoon before, so thanks for that - it looks like it might help with some things. Most things I've tried and failed to do inv
by nzentzis 6y ago
First off, I hadn't run into Hammerspoon before, so thanks for that - it looks like it might help with some things.
Most things I've tried and failed to do involve silent/background interaction with apps. For example, my company's VPN software doesn't handle sleep well at all, so I wanted to automatically disconnect before sleeping. I couldn't work out how to do it. The Mac Automation stuff (Automator and AppleScript) work if the app supports them, but my experience has been that support isn't necessarily reliable. Electron apps, at least, ignored my attempts last time I tried.
I figured out a way to do things using keyboard/mouse automation, but that fails in any context where I'm either actively doing something or where input isn't being accepted (e.g. when the lid is closed or when I'm actively editing code). On Linux I can at generally resort to Stupid X11 Hackery to make that kind of thing happen, though it sometimes needs WM integration if the app isn't cooperating.
- withinboredom 6y agoI wanted to use a different ssh-agent on OSx which is a very simple "I want to set a global environment variable." That's literally impossible in OSX. So, I had to open a shell and every app that I wanted to use my ssh-agent had to be launched from that shell.
- eyesee 6y agoIt's not impossible at all, you can just set it through `launchctl` as shown in this StackOverflow: https://stackoverflow.com/questions/135688/setting-environment-variables-on-os-x/3756686#3756686 https://stackoverflow.com/questions/135688/setting-environme...
- withinboredom 6y agoah, nice! I haven't tried to figure this out since Yosemite was new and it looks like there's now instructions for how to do it. Thanks for this! If I ever have to go back to OSX, now I know!