How to disable automatic suspend on Ubuntu 23.04

Endrit Qerreti

Endrit Qerreti

Automatic suspend is a feature that suspends your computer when you are not using it.

What this feature does, is that it allows you to specify how long your computer will stay active before suspending.

For example, if the automatic suspend timer is set to to 30 minutes, it means your computer will stay active for 30 minutes before going into suspend state.

However, if you don't want your system to go into suspended mode, then you can easily do this by disabling this feature.

There are two ways to disable the automatic suspend feature on Ubuntu, in this tutorial we'll cover both ways.

Disable Automatic Suspend using GUI

To disable automatic suspend, first you need to open Gnome Menu. Click to 'Activities overview'

Next, you need to open settings window. Click to the search box, and type 'Settings' and click it to go to Settings

Once you are in the Settings window. Go to 'Power' setting

Now under Power saving options, you will see that Automatic suspend option is turned on.

To turn it off, first click to Automatic Suspend

Clicking on Automatic suspend, will take you to the following window. All you have to do now is to click on each switch button to turn both options off.

Once turned off, click on X to close this window, and you should be good to use your computer without worrying that your system will go into suspended mode when you are away from your computer.

Disable Automatic Suspend using Terminal

Automatic suspend feature can also be disabled using the terminal.

Launch your terminal, and run the command below to disable Automatic suspend when computer is plugged in to ac

gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'

Next, you need to disable Automatic suspend when computer is running on battery

org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'

Once you disabled automatic suspend for battery and ac power, proceed to check the state of each option to ensure that both options are disabled.

To do this, simply run the commands below one by one

Check battery suspend state

gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type

Check AC power suspend state

gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type

As you can see, both options returned nothing as output, which means both options are now disabled.

Conclusion

In this tutorial, you learned how to disable automatic suspend feature on Ubuntu 23.04.