Keyboard Maestro macro for mac on battery power

I’d like to create a macro for keyboard maestro that will create a low battery power environment for my macbook pro. The key note always says the battery power should last about 12 hours, but mine lasts about 5… So:

I’d like to adjust the brightness to about 40% when it’s on battery, close background apps, and consume as little power as possible

Any of you got the solution to this one??

Here are the steps I do:

  • Using KM, dim screen 10 steps to get to Black, then brighten 4 steps. Adjust how you bright you like it. KM has an action to brighten and dim screen.
  • download blueutil to turn off bluetooth
    • /usr/local/bin/blueutil -p 0
  • echo PASSWORD | sudo -S mdutil -a -I off to turn off spotlight indexing
  • networksetup -setairportpower en0 off to turn off wifi

I don’t like auto closing apps. I think I heard Marco Arment as an app for that.

Yeah, that is Quitter, I have that installed