I'm looking for a general solution for this problem.
Because I need to do the coding outside. Sometimes the outside env doesn't have power supply.
Decrease cpu frequency
Turn off GPU
Turn off other devices when not used
sudo apt install tlp
sudo systemctl enable tlp
sudo apt install powertop
sudo systemctl enable powertop
sudo apt install cpupower-gui
sudo cpupower-gui
# use cpupower-gui to change the cpu frequency to minimum value
sudo apt install tlp
sudo systemctl enable tlp
sudo apt install powertop
sudo systemctl enable powertop
Install cpu-power-manager
and change the cpu-frequency to a minimum value:
https://extensions.gnome.org/extension/945/cpu-power-manager
sudo apt install powertop
sudo systemctl enable powertop
Install cpu-power-manager
and change the cpu-frequency to a minimum value:
https://extensions.gnome.org/extension/945/cpu-power-manager
From top-right-corner, from power-section, set graphics-mode to compute-graphics
and power-strategy to battery-life