I have a couple of Linux servers at my house and sometimes I will be viewing something on the screen for a long time and will continue to need to look back to the monitor for reference. Anyhow my monitors kept turning off or hibernating after about 15 to 30 minutes. Initially I thought this would be something I could modify in the BIOS of each of these computers but I was incorrect. The way to stop powersave mode in Linux is using the setterm command. Use the syntax below to turn off powersave mode and stop your monitor from going to sleep.
Stop Your Monitor From Sleeping:
- setterm -powersave off -blank 0
Verify the above works by waiting however long is necessary to show that the monitors are no longer getting turned off automatically.
The one thing that is annoying is the fact that setterm will not save that setting and it will only exist for the amount of time the server is up. If you are like me and the servers you are using are test servers they stand the chance to be rebooted often so could get annoying quick to have to type that in after every reboot. Add the below two lines to the /etc/rc.local file which will be executed at boot and solve the problem of having to type the setterm command in each time.
Add Below To /etc/rc.local:
- /usr/bin/setterm -powersave off -blank 0
Now the next time your computer reboots it will run the setterm command above and automatically stop your computer from using the powersave features. You should no longer have to worry about your monitor going to sleep or hibernating.