In many cases, auto-suspend is a convenient feature. It prevents screen burn and preserves power when you aren’t actively using your computer. If you work publicly, it can even protect your computer from snooping opportunists who may try to steal sensitive data while you’re away.
That’s not to say that auto-suspend is completely useful, however. It can frequently serve as a nuisance and interrupt your workflow, such as when you’re attempting to read a long webpage or actively run an application in the background. In these situations, disabling auto-suspend will allow you to make the best of your Linux system.
How to Disable Auto-Suspend Using the GUI
One of the easiest ways to disable auto-suspend on your computer is to use the Settings app. You can adjust system suspension settings in Ubuntu and similar distributions by navigating to Settings > Power. Click on Automatic Suspend and toggle the two setting options so that your computer does not automatically suspend when on battery power or plugged in.
If you aren’t opposed to using an application to prevent auto-suspend, you may also find that programs such as Caffeine help you resolve the issue. Otherwise, the process is similar for distributions that differ from Debian and Ubuntu like Arch Linux—though you may need to find distribution-specific configurations.
It’s worth noting that you may need to check your BIOS settings if your computer continues to automatically suspend or sleep despite adjusting the settings. After you've opened BIOS by rebooting your PC, you can typically configure sleep settings by navigating to the Power Management tab.
How to Disable Auto-Suspend From the CLI
You'll find it just as easy to disable auto-suspend using the command-line interface (CLI) on Linux, as you only need to enter a few commands on most distributions.
On Debian-based distributions such as Ubuntu and Linux Mint, you can disable the suspend daemon (and verify that its status reads as disabled) with the following commands:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target 
If you successfully disabled the daemons responsible for system hibernation and sleep, the second command should result in an output that reads “Loaded: masked (Reason: Unit [daemon].target is masked.) Active: inactive (dead)” for each daemon listed in the command. You may need to reboot the system before the changes will take effect.
The process of disabling automatic suspension in other distributions is similar, though you may need to research a few distribution forums for specific advice. In Arch Linux, adding the following lines to .xinitrc with sudo nano /etc/X11/xinit/xinitrc typically fixes the issue:
xset s off
xset -dpms
xset s noblank If you have a laptop that you would like to prevent from suspending after the lid closes, you will also need to edit the /etc/systemd.logind.conf configuration file. Open the file with the following command, add the lines that follow the asterisk, and close and save the file to disable system suspension caused by a closed laptop lid:
sudo nano /etc/systemd/logind.conf
*
[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore Entering the above command is vital if you intend to disable auto-suspend on a laptop. Otherwise, the systemd-logind daemon will attempt to call sleep.target hundreds of times per second when the lid is closed. While it might be a hassle to adjust logind.conf, it will save your computer’s CPU from being strained.
It’s important to note that auto-suspend can be re-enabled just as easily. If you want to run these system services again, you can enable them on your system by opening the terminal and entering the following commands:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target Take Care of Your Monitor After Disabling Auto-Suspend
Disabling auto-suspend is a great idea if you need to keep an application active or constantly display a particular screen. The fact that you can disable it in just a few steps is especially convenient.
If you decide to disable auto-suspend, you should make sure to configure new settings to prevent screen burn on your monitor.
ncG1vNJzZmivp6x7rq3KnqysnZ%2Bbe6S7zGiboquRl7mmecCuq6hlo6rAsbHNnWSipl2htq%2FB12g%3D