Control system power states (sleeping, preventing sleep, screen locking, etc)
NOTE: Any sleep preventions will be removed when hs.reload() is called. A future version of the module will save/restore state across reloads.
| Signature | hs.caffeinate.currentAssertions() |
|---|---|
| Type | Function |
| Description | Fetches information about processes which are currently asserting display/power sleep restrictions |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/internal.m |
| Signature | hs.caffeinate.declareUserActivity([id]) |
|---|---|
| Type | Function |
| Description | Informs the OS that the user performed some activity |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/caffeinate/internal.m |
| Signature | hs.caffeinate.fastUserSwitch() |
|---|---|
| Type | Function |
| Description | Show the Fast User Switch screen (ie a login screen without logging out first) |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/init.lua |
| Signature | hs.caffeinate.get(sleepType) -> bool or nil |
|---|---|
| Type | Function |
| Description | Queries whether a particular sleep type is being prevented |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/init.lua |
| Signature | hs.caffeinate.lockScreen() |
|---|---|
| Type | Function |
| Description | Locks the displays |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/caffeinate/internal.m |
| Signature | hs.caffeinate.logOut() |
|---|---|
| Type | Function |
| Description | Request the system log out the current user |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/init.lua |
| Signature | hs.caffeinate.restartSystem() |
|---|---|
| Type | Function |
| Description | Request the system reboot |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/init.lua |
| Signature | hs.caffeinate.sessionProperties() |
|---|---|
| Type | Function |
| Description | Fetches information from the display server about the current session |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/caffeinate/internal.m |
| Signature | hs.caffeinate.set(sleepType, aValue, acAndBattery) |
|---|---|
| Type | Function |
| Description | Configures the sleep prevention settings |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/caffeinate/init.lua |
| Signature | hs.caffeinate.shutdownSystem() |
|---|---|
| Type | Function |
| Description | Request the system log out and power down |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/init.lua |
| Signature | hs.caffeinate.startScreensaver() |
|---|---|
| Type | Function |
| Description | Request the system start the screensaver (which may lock the screen if the OS is configured to do so) |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/init.lua |
| Signature | hs.caffeinate.systemSleep() |
|---|---|
| Type | Function |
| Description | Requests the system to sleep immediately |
| Parameters |
|
| Returns |
|
| Source | extensions/caffeinate/internal.m |
| Signature | hs.caffeinate.toggle(sleepType) -> bool or nil |
|---|---|
| Type | Function |
| Description | Toggles the current state of the specified type of sleep |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/caffeinate/init.lua |