docs » hs.expose
Keyboard-driven expose replacement/enhancement
Warning: this module is still somewhat experimental. Should you encounter any issues, please feel free to report them on https://github.com/Hammerspoon/hammerspoon/issues or #hammerspoon on irc.freenode.net
With this module you can configure a hotkey to show thumbnails for open windows when invoked; each thumbnail will have
an associated keyboard "hint" (usually one or two characters) that you can type to quickly switch focus to that
window; in conjunction with keyboard modifiers, you can additionally minimize (alt
by default) or close
(shift
by default) any window without having to focus it first.
When used in combination with a windowfilter you can include or exclude specific apps, window titles, screens, window roles, etc. Additionally, each expose instance can be customized to include or exclude minimized or hidden windows, windows residing in other Mission Control Spaces, or only windows for the current application. You can further customize hint length, colors, fonts and sizes, whether to show window thumbnails and/or titles, and more.
To improve responsiveness, this module will update its thumbnail layout in the background (so to speak), so that it
can show the expose without delay on invocation. Be aware that on particularly heavy Hammerspoon configurations
this could adversely affect overall performance; you can disable this behaviour with
hs.expose.ui.fitWindowsInBackground=false
Usage:
-- set up your instance(s)
expose = hs.expose.new(nil,{showThumbnails=false}) -- default windowfilter, no thumbnails
expose_app = hs.expose.new(nil,{onlyActiveApplication=true}) -- show windows for the current application
expose_space = hs.expose.new(nil,{includeOtherSpaces=false}) -- only windows in the current Mission Control Space
expose_browsers = hs.expose.new{'Safari','Google Chrome'} -- specialized expose using a custom windowfilter
-- for your dozens of browser windows :)
-- then bind to a hotkey
hs.hotkey.bind('ctrl-cmd','e','Expose',function()expose:toggleShow()end)
hs.hotkey.bind('ctrl-cmd-shift','e','App Expose',function()expose_app:toggleShow()end)
- Variables - Configurable values
- ui
- Constructors - API calls which return an object, typically one that offers API methods
- new
- Methods - API calls which can only be made on an object returned by a constructor
- hide
- show
- toggleShow
Signature | hs.expose.ui |
---|---|
Type | Variable |
Description | Allows customization of the expose behaviour and user interface |
Signature | hs.expose.new([windowfilter[, uiPrefs][, logname, [loglevel]]]) -> hs.expose object |
---|---|
Type | Constructor |
Description | Creates a new hs.expose instance; it can use a windowfilter to determine which windows to show |
Parameters |
|
Returns |
|
Notes |
|
Signature | hs.expose:hide() |
---|---|
Type | Method |
Description | Hides the expose, if visible, and exits the modal mode. |
Parameters |
|
Returns |
|
Signature | hs.expose:show([activeApplication]) |
---|---|
Type | Method |
Description | Shows an expose-like screen with modal keyboard hints for switching to, closing or minimizing/unminimizing windows. |
Parameters |
|
Returns |
|
Notes |
|
Signature | hs.expose:toggleShow([activeApplication]) |
---|---|
Type | Method |
Description | Toggles the expose - see hs.expose:show() and hs.expose:hide() |
Returns |
|