This laptop overheats a lot, which makes it turn off a lot. As soon as I connect it to the charger, and it's in balanced power mode, the CPU temp goes over 100.
This is an adaptation of https://kobusvs.co.za/blog/power-profile-switching/
Charger increases battery temp a lot, combined with doing something heavy it skyrockets the CPU temp over 85 easily, meaning as soon as it is over 90 there is a 90% chance it will turn off soon.
This script switches the laptop into power-saving mode as soon as the charger is connected.
This script takes CPU temperature into account, meaning as soon as the CPU is constantly (for 10s) over 75 degrees, it will switch into power mode and check again in 5 minutes if it can go into balanced mode again.
This script takes CPU temperature into account, meaning as soon as the CPU is over 80 degrees, it will switch into power mode and check again in 5 minutes if it can go into balanced mode again.
store service: ~/.config/systemd/user/battery-goes-brrrrrrrrrrrr.service
enable service: systemctl --user enable --now battery-goes-brrrrrrrrrrrr.service check status of the service: systemctl --user status battery-goes-brrrrrrrrrrrr.service