Skip to content

Instantly share code, notes, and snippets.

@riandoza
Last active March 31, 2026 05:22
Show Gist options
  • Select an option

  • Save riandoza/49f551e584d30bf6ea6015be49486820 to your computer and use it in GitHub Desktop.

Select an option

Save riandoza/49f551e584d30bf6ea6015be49486820 to your computer and use it in GitHub Desktop.
macOS Clamshell Mode - Fix Battery Drain During Sleep

macOS Clamshell Mode - Fix Battery Drain During Sleep

Problem

Battery drains while Mac is in clamshell mode (lid closed) during sleep.

Common Causes

  • Apps holding sleep prevention assertions (e.g. WhatsApp camera bug)
  • Power Nap enabled (background activity during sleep)
  • Wake on network access enabled

Diagnose

# Check what's preventing sleep
pmset -g assertions

# Check sleep/wake log
pmset -g log | grep -E "(Sleep|Wake|Prevent)" | tail -30

# Check current power settings
pmset -g

Fix

1. Check and kill apps blocking sleep

pmset -g assertions | grep PreventUserIdleSystemSleep

Look for unexpected apps (e.g. WhatsApp, Zoom, browsers). Quit them or revoke camera/mic permissions via: System Settings → Privacy & Security → Camera

2. Apply power settings

sudo pmset -a disksleep 10
sudo pmset -a powernap 0
sudo pmset -a womp 0
Setting Value Reason
disksleep 10 Disk must sleep when system sleeps
powernap 0 Disable background sync during sleep
womp 0 Disable wake on network access

Verify

pmset -g

After closing lid, check battery after 30–60 mins to confirm drain is fixed.

Waking from Sleep

Disabling powernap and womp does not affect waking via physical input devices. Your Mac will still wake normally from:

Device Connection Works
Mouse USB or Bluetooth
Keyboard USB or Bluetooth
USB devices USB

These devices wake the Mac at the hardware level, independent of network wake settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment