Watch for screen layout changes This could be the addition or removal of a monitor, a screen resolution change, movement of a monitor in the Display preferences pane, etc.
Note that screen events which happen while your Mac is suspended, may not trigger the watcher in various circumstances (e.g. if you have FileVault enabled and the machine resumes out of hibernation - the screen events will be happening before the drive is unlocked and will not be reported to Hammerspoon)
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
Signature | hs.screen.watcher.new(fn) -> watcher |
---|---|
Type | Constructor |
Description | Creates a new screen-watcher. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/screen/libscreen_watcher.m line 75 |
Signature | hs.screen.watcher.newWithActiveScreen(fn) -> watcher |
---|---|
Type | Constructor |
Description | Creates a new screen-watcher that is also called when the active screen changes. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/screen/libscreen_watcher.m line 109 |
Signature | hs.screen.watcher:start() -> watcher |
---|---|
Type | Method |
Description | Starts the screen watcher, making it so fn is called each time the screen arrangement changes |
Parameters |
|
Returns |
|
Source | extensions/screen/libscreen_watcher.m line 137 |
Signature | hs.screen.watcher:stop() -> watcher |
---|---|
Type | Method |
Description | Stops the screen watcher's fn from getting called until started again |
Parameters |
|
Returns |
|
Source | extensions/screen/libscreen_watcher.m line 166 |