Window-based cmd-tab replacement
Usage:
-- set up your windowfilter
switcher = hs.window.switcher.new() -- default windowfilter: only visible windows, all Spaces
switcher_space = hs.window.switcher.new(hs.window.filter.new():setCurrentSpace(true):setDefaultFilter{}) -- include minimized/hidden windows, current Space only
switcher_browsers = hs.window.switcher.new{'Safari','Google Chrome'} -- specialized switcher for your dozens of browser windows :)
-- bind to hotkeys; WARNING: at least one modifier key is required!
hs.hotkey.bind('alt','tab','Next window',function()switcher:next()end)
hs.hotkey.bind('alt-shift','tab','Prev window',function()switcher:previous()end)
-- alternatively, call .nextWindow() or .previousWindow() directly (same as hs.window.switcher.new():next())
hs.hotkey.bind('alt','tab','Next window',hs.window.switcher.nextWindow)
-- you can also bind to `repeatFn` for faster traversing
hs.hotkey.bind('alt-shift','tab','Prev window',hs.window.switcher.previousWindow,nil,hs.window.switcher.previousWindow)
Signature | hs.window.switcher.ui |
---|---|
Type | Variable |
Description |
Allows customization of the switcher behaviour and user interface |
Source | extensions/window/window_switcher.lua line 53 |
Signature | hs.window.switcher.nextWindow() |
---|---|
Type | Function |
Description |
Shows the switcher (if not yet visible) and selects the next window |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/window/window_switcher.lua line 318 |
Signature | hs.window.switcher.previousWindow() |
---|---|
Type | Function |
Description |
Shows the switcher (if not yet visible) and selects the previous window |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/window/window_switcher.lua line 331 |
Signature | hs.window.switcher.new([windowfilter[, uiPrefs][, logname, [loglevel]]]) -> hs.window.switcher object |
---|---|
Type | Constructor |
Description |
Creates a new switcher instance; it can use a windowfilter to determine which windows to show |
Parameters |
|
Returns |
|
Source | extensions/window/window_switcher.lua line 393 |
Signature | hs.window.switcher:next() |
---|---|
Type | Method |
Description |
Shows the switcher instance (if not yet visible) and selects the next window |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/window/window_switcher.lua line 285 |
Signature | hs.window.switcher:previous() |
---|---|
Type | Method |
Description |
Shows the switcher instance (if not yet visible) and selects the previous window |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/window/window_switcher.lua line 298 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.window.switcher.html