Advanced

MacBook lid-close sleep terminal workaround

Last updated: April 20, 2026

This page documents an advanced terminal workaround for manually controlling MacBook lid-close sleep outside the Mac App Store version of Rouse.

This is a terminal-level workaround, not an official macOS API or a Mac App Store feature of Rouse. It changes a system-wide power setting and requires administrator privileges. Behavior may vary across Mac models and macOS versions.

The Mac App Store build cannot ship this as a feature because this workaround depends on administrator-level pmset power changes outside the normal App Sandbox boundary.

Quick commands

Add this function to your ~/.zshrc or another shell profile:

rouse() {
  case "$1" in
    on)
      sudo pmset -a disablesleep 1
      pmset -g | awk '/^[[:space:]]*SleepDisabled[[:space:]]/ { print "SleepDisabled =", $2 }'
      ;;
    off)
      sudo pmset -a disablesleep 0
      pmset -g | awk '/^[[:space:]]*SleepDisabled[[:space:]]/ { print "SleepDisabled =", $2 }'
      ;;
    status)
      pmset -g | awk '/^[[:space:]]*SleepDisabled[[:space:]]/ { print "SleepDisabled =", $2 }'
      ;;
    *)
      echo "usage: rouse {on|off|status}"
      return 1
      ;;
  esac
}

Reload your shell, then use rouse on, rouse off, and rouse status.

What it actually does

Because disablesleep=1 blocks both idle sleep and lid-close sleep, the Mac will also stay awake when left untouched on the desktop. Run rouse off as soon as you are done.

Boundaries

How to remove it

About this page

The Mac App Store version of Rouse stays within what the App Sandbox allows. This page documents the terminal-level workaround for advanced users who are comfortable changing system power settings. The rouse shell function shown on this page is a standalone helper that lives in your shell profile; it is not a command-line interface for the Mac App Store version of Rouse.