Skip to content

Instantly share code, notes, and snippets.

@tternes
Created February 1, 2013 05:38
Show Gist options
  • Save tternes/4689521 to your computer and use it in GitHub Desktop.
Save tternes/4689521 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Source: http://hints.macworld.com/article.php?story=20120701234338952
# Have you ever been annoyed to find that your Mac won't got to sleep when you tell it to?
# It turns out that in Mac OS X 10.6 and later, there's a simple way of finding out what's
# keeping your Mac awake.
# Run the following command in your Terminal:
# pmset -g assertions
# In the first section of output, you'll see the status of two kernel assertions named
# PreventSystemSleep and PreventUserIdleSystemSleep. An accompanying status of 1 for
# either of these means that it is currently triggered.
# The second section of the output lists the processes which owns any enabled assertions,
# both by process id (pid) and bundle id. If the verbose bundle id doesn't ring a bell,
# you can always use ps up <pid>, or look in Activity Monitor, to find the name of the
# exact command associated with this process.
pmset -g assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment