macOS application aware, keyboard driven window switcher. Spoon on top of Hammerspoon.
Download: https://github.com/Hammerspoon/Spoons/raw/master/Spoons/AppWindowSwitcher.spoon.zip
Switches windows by focusing and raising them. All windows matching a bundelID, a list of bundleID's, an application name matchtext, or a list of application name matchtexts are switched by cycling them. Cycling applies to visible windows of currently focused space only. The spoon does not launch applications, it operates on open windows of running applications.
Example ~/.hammerspoon/init.lua
configuration:
hs.loadSpoon("AppWindowSwitcher")
-- :setLogLevel("debug") -- uncomment for console debug log
:bindHotkeys({
["com.apple.Terminal"] = {hyper, "t"},
[{"com.apple.Safari",
"com.google.Chrome",
"com.kagi.kagimacOS",
"com.microsoft.edgemac",
"org.mozilla.firefox"}] = {hyper, "q"},
["Hammerspoon"] = {hyper, "h"},
[{"O", "o"}] = {hyper, "o"},
})
In this example,
hyper-t
cycles all terminal windows (matching a single bundleID),hyper-q
cycles all windows of the five browsers (matching either
of the bundleIDs)hyper-h
brings the Hammerspoon console forward (matching the
application title),hyper-o
cycles all windows whose application title starts
with "O" or "o".The cycling logic works as follows:
Signature | AppWindowSwitcher:bindHotkeys(mapping) -> self |
---|---|
Type | Method |
Description | Binds hotkeys for AppWindowSwitcher |
Parameters |
|
Returns |
|
Notes | The mapping table accepts these formats per table element:
|
Source | Source/AppWindowSwitcher.spoon/init.lua line 94 |
Signature | AppWindowSwitcher:setLogLevel(level) -> self |
---|---|
Type | Method |
Description | Set the log level of the spoon logger. |
Parameters |
|
Returns |
|
Source | Source/AppWindowSwitcher.spoon/init.lua line 153 |