1

I disable Automatic graphics switching under Energy Saver, as it significantly slows my Macbook Pro (10.15.5). Yet this checkbox keeps getting re-enabled when I have not touched it!

How can I prevent that? Or failing that, how can I disable this from the command line? (I'll write a script to run every ten minutes.)

Energy Saver,

4
  • 1
    See apple.stackexchange.com/q/362502/237687
    – Solar Mike
    Jun 25, 2020 at 10:19
  • Thank you. That will be useful. But do you know how to keep the setting from auto-enabling itself in the first place?
    – Joshua Fox
    Jun 25, 2020 at 10:38
  • 1
    Have you noticed if it changes after a restart? or after waking from sleep?
    – Solar Mike
    Jun 25, 2020 at 10:40
  • It gets enabled after restart, but not after sleep.
    – Joshua Fox
    Jun 25, 2020 at 14:10

1 Answer 1

0

Use this script to turn off the Energy Saver Automatic graphic switching option.

  • Save it on your Macbook, e.g., as noautosaver.
  • Make it executable with chmod a+x noautosaver.
  • Add the script in System Preferences > Login Items.

It is the same code as in the linked question, but always turns the value Off rather than toggling the value.

 #!/usr/bin/osascript

 if running of application "System Preferences" then
     try
         quit application "System Preferences"
     on error
         do shell script "killall 'System Preferences'"
     end try
 end if

 repeat while running of application "System Preferences" is true
     delay 0.1
 end repeat

 tell application "System Preferences"
     reveal pane id "com.apple.preference.energysaver"
     repeat until exists window "Energy Saver"
         delay 0.1
     end repeat
 end tell

 tell application "System Events" to tell ¬
     group 1 of window "Energy Saver" of application process "System Preferences"
     repeat until exists checkbox "Automatic graphics switching"
         delay 0.1
     end repeat

     set cbAGS to (value of checkbox "Automatic graphics switching") as boolean
     if cbAGS then
        click checkbox "Automatic graphics switching"
     end if
     set  cbAGS to (value of checkbox "Automatic graphics switching") as boolean
 end tell

 quit application "System Preferences"

 if cbAGS then
     return "   Automatic Graphics Switching is: ON"
 else
     return "   Automatic Graphics Switching is: OFF"
 end if

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .