hammerspoon2-docs
    Preparing search index...

    Function preventSleep

    • Prevents the specified type of system sleep.

      Creates an IOKit power assertion that stops macOS from allowing the specified type of sleep. Call allowSleep with the same type to release the assertion.

      Parameters

      • type: string

        The sleep type to prevent. One of: "display" (prevent display

      Returns boolean

      true if the assertion was created successfully.