Browse the docs

screenSaver

Returns 1 when the screen saver is showing, the display is asleep or the screen is locked, and 0 otherwise.

Keyboard Maestro: SCREENSAVER

Details #

screenSaver() takes no arguments and returns 1 or 0. It is 1 when the screen saver engine is running, when the main display is asleep, or when the login session reports the screen as locked.

Parameters #

Takes 0 arguments. {{ screenSaver() }}

Examples #

screenSaver()
→ 0
screenSaver() == 0
→ true

Gotchas #

  • Calling it with an argument is an error: screenSaver() takes 0 arguments, got 1.

  • It is a number, not true/false, so compare it with == 1 or use it directly in a condition.

  • With nothing real to read, the answer is 0.