I made a script that monitors the power state of the laptop and automatically toggles the following things:
- Limit the CPU boost frequency to something more reasonable using
cpufreqwhen not plugged in. - I limit the GPU to 32W when on battery and 42W when charging over USB-C, while giving it the unrestricted 100W when running from the normal power charger. I tried fully turning off the GPU but there's no measurable benefit in battery life compared to this setup (GPU goes to ~0W when idle anyway).
- I set refresh rate of the display to 60hz on battery (144hz when plugged in)
- I turn of half the cores of my 8 core CPU om battery (this is pretty aggressive, and does not result in better battery life on all platforms - your mileage may vary)
That takes me from 4-5h to ~8-10 and the computer is still very useable.
Mine is an AMD device but Nvidia offers similar toggles through the nvidia-smi command.