Laptop 24/7
How can I keep my laptop open 24/7 and automatically suspend/poweroff when it reaches a specific temperature or fan speed?
Weird question I know
About this post
- Posted
- Archived
- Score
- 0 · 50% up
- Kind
- Text
- ID
- vugedb
How can I keep my laptop open 24/7 and automatically suspend/poweroff when it reaches a specific temperature or fan speed?
Weird question I know
6 comments
It's not weird at all. You know laptops are not built for that and you want yours to live. For that, I can only think of creating a shell script.
Even if you use Arch, I'd post that somewhere since it's not an Arch-specific question.
Sounds a bit complicated but as a laptop user I would love to have a solution for that and have my laptop that I use as a desktop turned on 24/7, if you find a solution let me know.
Creating a shell script for that wouldn't be hard. Create an infinite loop using
whileand inside it a condition usingifto check the fan RPM, CPU temp, or both and define actions for when they reach the threshold you set. There are several tools that print the fan RPM and the CPU temp you can use in the script.Deleted before we saved it.
Is one of the questions you're asking about how to not do anything when the lid is closed?
On GNOME you can disable automatic suspension on power settings. It's probably similar for KDE.
If you don't use any DE, you can edit your
/etc/systemd/logind.confand setHandleLidSwitchtoignore. Ensure you reload it bysystemctl kill -s HUP systemd-logind.Now as to doing some action after reaching some temperature or fan speed you can check this https://unix.stackexchange.com/questions/127996/run-command-when-temperature-exceeds-threshold-without-daemon