Skip to content

Instantly share code, notes, and snippets.

@carlashley
Last active April 3, 2017 06:25
Show Gist options
  • Save carlashley/5e0271a360a611ecaca769c08364b753 to your computer and use it in GitHub Desktop.
Save carlashley/5e0271a360a611ecaca769c08364b753 to your computer and use it in GitHub Desktop.
Current power settings
#!/usr/bin/python
# A dictionary of current power settings from various system configurations
from SystemConfiguration import (
SCDynamicStoreCreate,
SCDynamicStoreCopyValue,
)
ds = SCDynamicStoreCreate(None, 'power', None, None)
result = SCDynamicStoreCopyValue(ds, 'State:/IOKit/PowerManagement/CurrentSettings')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment