Execute the command as a user with sudo privileges while awake from sleep.
Execute the command as a user with sudo privileges while awake from sleep.
I recently made the switch to Linux entirely on my laptop about three months ago. My desktop still keeps a Windows partition for things that don’t run smoothly on Linux, especially at school. Overall, everything functions well, and Linux has proven itself better for managing the servers I run at home. The only hiccup is with my laptop’s performance when plugged into a power brick—it throttles down to 800MHz and becomes extremely slow. On Windows, I resolved it by using Throttlestop at startup, but Linux seems more complicated. I’ve created a simple BASH script that seems to fix the speed issue, though it needs refreshing every time I power off and turn it back on. I’m used to opening a terminal and running it each login, but I’m looking for a smarter method. My main concern is setting up this script to activate automatically when the system wakes up. I’ve seen some guides about cron jobs or systemd services, but they often assume the script runs without being started as a service, which doesn’t always work. I suspect it would help using a cron job or a systemd timer, though I’m not entirely sure how to configure those.
Your laptop is an HP Pavilian Power with an i5 7300H and GTX 1050. You’re currently using OpenSUSE Tumbleweed KDE, but if you’re open to changing distros, that’s fine. The script you shared is a bit rough, but it looks like it’s trying to adjust CPU frequencies under different power states.
If you need further guidance, feel free to ask—I’m here to help!
You can configure that with TLP I believe. https://linrunner.de/tlp/settings/processor.html There is also TLPUI , which is a GUI for TLP.
The concern is that this tool doesn’t seem equipped to resolve my problems. On Throttlestop it was labeled "BD_PROCHOT," which appears to be the sensor indicating issues with my CPU. The final three lines of my script actually address the problem, while the first four ensure stable operation at 800MHz and maintain temperatures below desired levels. Checking the TLP documentation reveals no available option for "BD_PROCHOT." If such a setting exists but isn’t visible, please inform me—it suggests TLP lacks the necessary feature to fix my situation.
You can configure your script to launch automatically when the system wakes up via systemd. Refer to this guide for details: https://itectec.com/ubuntu/ubuntu-run-a-...m-suspend/
This matches the guide you were looking for. I adjusted the script to run successfully, and it’s now functioning without problems.