There's a utility called TLP that can get you most of the way there. It's not perfect, but I've found it useful on the newer thinkpads with dual batteries (one embedded + one removable).
https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-ma...
https://wiki.archlinux.org/index.php/TLP