Last active
April 3, 2017 06:25
-
-
Save carlashley/5e0271a360a611ecaca769c08364b753 to your computer and use it in GitHub Desktop.
Current power settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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