Every 60s: toggle dark mode if on battery (save previous value). If back on power, revert to previous value.
NB: You'll get a notification when changed.
~/toggle_dark_mode.sh
(don't forget tochmod u+x
it)~/Library/LaunchAgents/com.user.toggle_dark_mode.plist
https://twitter.com/abernier_/status/1698645537958883422?s=20