automatic_suspend_feature

How to set automatic suspend timing using Terminal in Ubuntu Linux?

In Linux, suspend is a power-saving state that allows you to put your Linux machine into a low-power mode, when you suspend your computer, the system saves all the contents of your RAM to your Hard disk and puts your system into suspend state. When you are working on your Linux machine, you may open lot of applications and Terminal sessions, when your system is in an idle state, then Linux automatically suspends your system and the computer draws very little power on this system. When you resume, system will quickly return to its previous state. You can set the timing when to system moves for suspend state, once you set the timings, after that particular time, the system will automatically goes to suspend state. You can set the suspend time on battery mode as well as power-plugin mode. There are several types of suspend modes in Linux, including Suspend-to-RAM (also known as “standby”), Suspend-to-Disk (also known as “hibernate”), and hybrid-suspend which combines aspects of both Suspend-to-RAM and Suspend-to-Disk. This article will guide you to set automatic suspend timing using Terminal in Ubuntu Linux.

Automatic suspend timing using Terminal in Ubuntu Linux:

You can set the automatic suspend timing using two different methods in Ubuntu Linux.

Method 1: Using Ubuntu Settings

Open Ubuntu Settings, click on the Show application icon, from the bottom left corner, and choose Settings.

Under Settings from the left-hand side click on Power, From the right-hand side you can see the Power Saving options.

Under the Power Saving options section, click on Automatic Suspend and set the timings for On Battery power and Plugged in.

Automatic Suspend

Click on the drop-down menu and choose the time.

set automatic suspend timing using GUI

Once you set the time, closing the settings window. The system will automatically move to suspend state after the amount of time you have set.

In GUI mode, you can set the timing from 15mins to 2 Hours. But using Linux terminal command you can set the timing below 15 mins or more than 2 hours.

Method 2: Using Terminal

Open the terminal application on your Ubuntu system. Press Ctrl + Alt + T to open Terminal.

Type the following command to enable automatic suspend after a certain amount of inactivity:

gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout <timeout_value_in_seconds>

Replace <timeout_value_in_seconds> with the number of seconds of inactivity before automatic suspend is triggered. For example, to enable automatic suspend after 10 minutes of inactivity, you would use a timeout value of 600 seconds:

set automatic suspend timing using Terminal

This command set the automatic suspend timings for Laptop lid open and connected to charger condition.

gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'

This Command automatically suspend the system when the lid is closed while the system is plugged into charger.

Enable automatic suspend after a certain period of inactivity when your laptop is running on battery power.

gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout <timeout_value_in_seconds>

Replace <timeout_value_in_seconds> with the number of seconds of inactivity before automatic suspend is triggered. For example, to enable automatic suspend after 10 minutes of inactivity when running on battery power, you would use a timeout value of 600 seconds:

To set the timing when the lid closed and laptop running on battery use the following command.

gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'

This will cause the system to automatically suspend when the laptop lid is closed while running on battery power.

Read Also:

Default Linux Directories Explained

How to Format USB drive in Linux Using Terminal?

How to install Google Chrome Using Terminal In Ubuntu Linux?

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top