-
-
Save patricksamson/dfaf62a8b69b70877336 to your computer and use it in GitHub Desktop.
Toggle between "discrete GPU only" and "automatic switching" on a 15" Retina MacBook Pro.
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
tell application "System Preferences" | |
reveal pane "com.apple.preference.energysaver" | |
end tell | |
tell application "System Events" to tell process "System Preferences" to tell window "Energy Saver" | |
set status to value of checkbox "Automatic graphics switching" of group 1 | |
click checkbox "Automatic graphics switching" of group 1 | |
end tell | |
quit application "System Preferences" | |
if status is 0 then | |
return "Automatic switch activated" | |
else | |
return "Discrete graphics only" | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment