I have the following bindings in my config which no longer work with the latest version
hs.hotkey.bind({"ctrl", "shift"}, "N", hs.window.filter.focusWest)
hs.hotkey.bind({"ctrl", "shift"}, "M", hs.window.filter.focusSouth)
hs.hotkey.bind({"ctrl", "shift"}, ",", hs.window.filter.focusNorth)
hs.hotkey.bind({"ctrl", "shift"}, ".", hs.window.filter.focusEast)
nothing happens when I press the keys. changing the functions to hs.alert.show does display an alert.
I downgraded to 0.9.80, and the bindings work again
<Sigh>... yet another place where the past practice of mixing methods and functions within hs.window has broken things as we clean up and standardize.
See https://github.com/Hammerspoon/hammerspoon/issues/2517#issuecomment-701109731 for the explanation.
I'll see about fixing hs.window.filter this weekend.
It's not meant to be a permanent fix and I make no promises that it will work in the future but you can add the following to your primary Hammerspoon config file In the mean time and your existing code should work for now.
~lua
local window = require("hs.window") -- make sure this is loaded
local winMT = getmetatable(window)
local original_index = winMT.__index
winMT.__index = function(self, key)
local answer = original_index(self, key)
if answer then
return answer
else
return hs.getObjectMetatable("hs.window")[key]
end
end
~
@fent, Just a reminder, when #2576 lands and a new release is made, you should remove the above fix, if you've applied it. It won't break anything at the moment, but I can't guarantee the future.
I tried building from head to get this fix, and it works great. Thank you!
Most helpful comment
<Sigh>... yet another place where the past practice of mixing methods and functions within
hs.windowhas broken things as we clean up and standardize.See https://github.com/Hammerspoon/hammerspoon/issues/2517#issuecomment-701109731 for the explanation.
I'll see about fixing
hs.window.filterthis weekend.It's not meant to be a permanent fix and I make no promises that it will work in the future but you can add the following to your primary Hammerspoon config file In the mean time and your existing code should work for now.
~lualocal window = require("hs.window") -- make sure this is loaded
local winMT = getmetatable(window)
local original_index = winMT.__index
winMT.__index = function(self, key)
local answer = original_index(self, key)
if answer then
return answer
else
return hs.getObjectMetatable("hs.window")[key]
end
end
~