New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spaces.lua's search for Dock does not succeed on early startup #3598
Comments
Yeah, it's looking for a running instance of the Dock, so it will fail if Hammerspoon somehow manages to start before the Dock. But all it's actually doing with it at that point is trying to find the Dock app on disk, so I think it could probably be changed to: local path = application.pathForBundleID("com.apple.dock") .. "/Contents/Resources" (It does try to actually talk to the running Dock later on, to interact with Mission Control/Spaces - but the Dock is likely to be running by the time you're using any of those functions.) If you want to try out that change, you can copy
|
I've never run into a timing issue this tight, but As noted, the running Dock is important when you trigger it, but not at load time. |
Would I run into issues if I just edited the app itself for testing? |
Not sure when I started seeing this, perhaps in the first beta of 14.4? But this line of code fails for me when Hammerspoon opens on startup:
hammerspoon/extensions/spaces/spaces.lua
Line 57 in 56b5835
Here's the error:
If I reload the config it works as expected, so I assume whenever this runs is too early for this to return any results?
The text was updated successfully, but these errors were encountered: