Trigger or prevent screen saver/sleep by moving your mouse pointer to specified hot corners on your screen.
While this functionality is provided by macOS in the Mission Control System Preferences, it doesn't provide any type of visual feedback so it's easy to forget which corners have been assigned which roles.
For best results while using this spoon, it is recommended that you disable "Start Screen Saver" and "Disable Screen Saver" if they are currently assigned to a corner with the Mission Control System Preferences Panel as this Spoon can't override them and may result in confusing or incorrect behavior.
The visual feed back provided by this spoon is of a small plus (for triggering sleep now) or a small minus (to prevent sleep) when the mouse pointer is moved into the appropriate corner. This feedback was inspired by a vague recollection of an early Mac screen saver (After Dark maybe?) which provided similar functionality. If someone knows for certain, please inform me and I will give appropriate attribution.
Note that sleep prevention is not guaranteed; macOS may override our attempts at staying awake in extreme situations (CPU temperature dangerously high, low battery, etc.) See hs.caffeinate
for more details.
Download: https://github.com/Hammerspoon/Spoons/raw/master/Spoons/SleepCorners.spoon.zip
Signature | SleepCorners.feedbackSize |
---|---|
Type | Variable |
Description | Specifies the height and width in screen pixels, default 20, of the visual feedback to be displayed when the mouse pointer moves into one of the recognized hot corners |
Source | Source/SleepCorners.spoon/init.lua line 99 |
Signature | SleepCorners.immediateSleepModifiers |
---|---|
Type | Variable |
Description | A table, default |
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 120 |
Signature | SleepCorners.immediateSleepShouldLock |
---|---|
Type | Variable |
Description | Specifies whether the sleep now corner, when the modifiers defined for SleepCorners.immediateSleepModifiers are also held, should trigger the display sleep or lock the users session. Defaults to true. |
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 143 |
Signature | SleepCorners.neverSleepCorner |
---|---|
Type | Variable |
Description | Specifies the location of the never sleep corner on the screen. Defaults to "LR". |
Source | Source/SleepCorners.spoon/init.lua line 86 |
Signature | SleepCorners.neverSleepLockModifiers |
---|---|
Type | Variable |
Description | A table, default |
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 152 |
Signature | SleepCorners.preferSleepNow |
---|---|
Type | Variable |
Description | Specifies which action should be preferred if both the sleep now and never sleep hot corners are assigned to the same location on the screen. The default is false. |
Source | Source/SleepCorners.spoon/init.lua line 111 |
Signature | SleepCorners.sleepDelay |
---|---|
Type | Variable |
Description | Specifies the number of seconds, default 2, the mouse pointer must remain within the trigger area of the sleep now corner in order to put the system's display to sleep. |
Source | Source/SleepCorners.spoon/init.lua line 55 |
Signature | SleepCorners.sleepNowCorner |
---|---|
Type | Variable |
Description | Specifies the location of the sleep now corner on the screen. Defaults to "LL". |
Source | Source/SleepCorners.spoon/init.lua line 73 |
Signature | SleepCorners.sleepNowShouldLock |
---|---|
Type | Variable |
Description | Specifies whether the sleep now corner should trigger the display sleep or lock the users session. Defaults to false. |
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 134 |
Signature | SleepCorners.sleepScreen |
---|---|
Type | Variable |
Description | Specifies the screen on which the sleep corners are made active. Defaults to the value returned by |
Source | Source/SleepCorners.spoon/init.lua line 62 |
Signature | SleepCorners.triggerSize |
---|---|
Type | Variable |
Description | Specifies the height and width in screen pixels, default 2, of the trigger area for the recognized hot corners. |
Source | Source/SleepCorners.spoon/init.lua line 104 |
Signature | SleepCorners:bindHotkeys(mapping) -> self |
---|---|
Type | Method |
Description | Binds hotkeys for SleepCorners |
Parameters |
|
Returns |
|
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 632 |
Signature | SleepCorners:isActive() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the sleep corners are currently active |
Parameters |
|
Returns |
|
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 458 |
Signature | SleepCorners:show([duration]) -> self |
---|---|
Type | Method |
Description | Temporarily show the SleepCorner feedback images in their current locations as a reminder of their positions on the screen. |
Parameters |
|
Returns |
|
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 580 |
Signature | SleepCorners:start() -> self |
---|---|
Type | Method |
Description | Starts monitoring the defined sleep corners to allow triggering or preventing the system display sleep state. |
Parameters |
|
Returns |
|
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 478 |
Signature | SleepCorners:stop() -> self |
---|---|
Type | Method |
Description | Stop monitoring the defined sleep corners. |
Parameters |
|
Returns |
|
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 508 |
Signature | SleepCorners:toggle([state]) -> self |
---|---|
Type | Method |
Description | Toggles or sets whether or not SleepCorners is currently monitoring the defined screen corners for managing the system display's sleep state and displays an alert indicating the new state of the SleepCorners spoon. |
Parameters |
|
Returns |
|
Notes |
|
Source | Source/SleepCorners.spoon/init.lua line 544 |