Setting Energy Saver Preferences on macOS Mojave/High Sierra
Warning: compact(): Undefined variable $post_id in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $order in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $meta_key in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $featured in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $attachment in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $scan in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $scan_raw in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $callback in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $default in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $split_content in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $size in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $srcset_sizes in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $link in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $link_class in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $image_class in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $width in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $height in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $before in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $after in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $min_width in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $min_height in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $caption in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $meta_key_save in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $thumbnail_id_save in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $cache in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $format in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $echo in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $custom_key in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $default_size in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $the_post_thumbnail in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $image_scan in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $default_image in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $order_of_image in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
Warning: compact(): Undefined variable $link_to_post in /srv/http/nickmcummins.com/wp-content/themes/epic-base/vendor/composer/justintadlock/hybrid-core/ext/get-the-image.php on line 307
System preferences can be set on macOS using the defaults
command. For example, say I wish set the Prevent sleep setting that can be set through the System Preferences interface, but instead via command line.
If your settings match those in the screenshot above, running defaults read /Library/Preferences/com.apple.PowerManagement.plist
in the terminal should output
{ "AC Power" = { "Automatic Restart On Power Loss" = 1; DarkWakeBackgroundTasks = 1; "Disk Sleep Timer" = 180; "Display Sleep Timer" = 5; "Display Sleep Uses Dim" = 1; GPUSwitch = 2; "System Sleep Timer" = 15; "Wake On LAN" = 1; }; "Battery Power" = { "Automatic Restart On Power Loss" = 1; DarkWakeBackgroundTasks = 0; "Disk Sleep Timer" = 180; "Display Sleep Timer" = 5; "Display Sleep Uses Dim" = 1; GPUSwitch = 2; ReduceBrightness = 1; "System Sleep Timer" = 10; "Wake On LAN" = 1; }; SystemPowerSettings = { DestroyFVKeyOnStandby = 0; "Update DarkWakeBG Setting" = 1; }; }
To set System Sleep Timer to 0, run /usr/libexec/PlistBuddy -c "Set 'AC Power':'System Sleep Timer' 0" /Library/Preferences/com.apple.PowerManagement.plist
. Now running the original defaults read command will output
{ "AC Power" = { "Automatic Restart On Power Loss" = 1; DarkWakeBackgroundTasks = 1; "Disk Sleep Timer" = 180; "Display Sleep Timer" = 5; "Display Sleep Uses Dim" = 1; GPUSwitch = 2; "System Sleep Timer" = 0; "Wake On LAN" = 1; }; "Battery Power" = { "Automatic Restart On Power Loss" = 1; DarkWakeBackgroundTasks = 0; "Disk Sleep Timer" = 180; "Display Sleep Timer" = 5; "Display Sleep Uses Dim" = 1; GPUSwitch = 2; ReduceBrightness = 1; "System Sleep Timer" = 10; "Wake On LAN" = 1; }; SystemPowerSettings = { DestroyFVKeyOnStandby = 0; "Update DarkWakeBG Setting" = 1; }; }
Now opening the System Preferences will reveal the updated value.