Temporary change in powermanagement

Hi! I'm new to this forum. I am an ex-ubuntu user that wants to try out a rolling distro for my next work machine.

I have recently acquired a Thinkpad T480s with a i7-8650U cpu which i have installed manjaro on.
The machine and configuration works fine, but i have noticed that when running on battery it powers down the cpu or gpu a little too much.
When looking at videos/youtube in fullscreen there are some glitches that makes watching stuff unbearable. This does not happen once a power cable is plugged in.

However. The battery capacity when on low power is great. I can work on the machine about 8 hours without charging. So obviously I don't want to make a permanent change to the power management.

I've started looking on TLP and tlp-gui to see if there is a way to set the cpu throttling lower. And it seems that there is functionality to do that - but what I need is a simple way to change the CPU_HWP_ON_BAT from "power" to "balance_performance" whenever i want to watch something on youtube.

Is there a widget that can do that for me ?
Can anyone point me in the right direction ?

Thanks!!

https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#commands

Since you appear to be using Gnome according to your profile, this extension makes life really easy, you can even create your own power profiles. https://extensions.gnome.org/extension/945/cpu-power-manager/

1 Like

edit /etc/default/tlp
find correct line (60 for me) and put CPU_HWP_ON_BAT=balance_performance
restart tlp with:
sudo systemctl restart tlp

Knowing that you can script it, for exemple:

#! /usr/bin/bash
sed -ri 's/CPU_HWP_ON_BAT\=.+/CPU_HWP_ON_BAT=balance_performance/g' /etc/default/tlp
systemctl restart tlp

Then revert it:

#! /usr/bin/bash
sed -ri 's/CPU_HWP_ON_BAT\=.+/CPU_HWP_ON_BAT=power/g' /etc/default/tlp
systemctl restart tlp

/!\ Test them on a dummy file before, don't trust me :japanese_goblin: /!\

1 Like

Thanks for the suggestions. The gnome-extension worked really well!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by