brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: pmset -g assertions shows what keeps your Mac awake

Mac terminal
~/tips/tip-macos-pmset-assertions

pmset -g assertions

Lists which programs are stopping your Mac from going to sleep.

Your Mac refuses to sleep and you have no idea why. macOS can tell you.

Programs can ask the system not to sleep. That request is called a power assertion. pmset has a mode that lists them, per process.

pmset -g assertions

The man page describes it as a summary of power assertions that may prevent system sleep or display sleep. Look at the process names in the output. A video call, a download manager or a backup tool will usually show up there, and then the mystery is over.

For example, run it when the lid is open, the screen is dark and the fan is still spinning. If a browser or a meeting app is on the list, close it and run the command again to see the entry disappear.

One caveat. The command only reports. It does not tell you whether the assertion is justified, so do not quit a backup halfway because it is on the list. Also, a quiet list means something else is going on, such as a USB device or a setting in System Settings.

I like this one because it turns a vague feeling (the Mac will not sleep) into a name you can search for. Once you know the process, you can read its settings, quit it politely or accept that it is doing its job.

Further reading: pmset.1 man page, On this site: pbcopy puts the output of any command on your Mac clipboard, On this site: caffeinate stops your Mac from sleeping while a long command runs

More Mac terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac screencapture -R 0,0,1280,720 ~/Desktop/step-1.png leaks -atExit — ./myprogram --some-option All Mac terminal tips (60) All topics

Link