0

How can I disabled the automatic suspend in Elementary OS 0.5.

It seems there is a very aggressive automatic suspend for laptops in Elementary OS.

In Settings -> Power -> "Suspend when inactive for" set to "Never". (both on plugged in and on battery option).

If I use the gnome tweaks and set to false the "Suspend when dim closed." the same result... The laptop goes to suspend itself in 15 minutes.

The TLP laptop library is installed.

For me this is very tricky. I used to use Ubuntu OS, but I never experienced this aggressive suspend problem.

1

Unfortunately there's a current bug in elementaryOS that prevents suspend power settings from being respected. I can't provide a fix as none of the suggestions in the relevant bug threads work in any reliable manner, but I can suggest that if there is something you need to run without having the system suspend, you can use systemd-inhibit to accomplish this.

systemd-inhibit --mode=block --what=sleep <command-or-program-you-want-to-run>
0

This bug has been reported here and here, in much more detail.

It seems the fix is:

# become the superuser
sudo su
# launch a bash shell as lightdm
su - -s /bin/bash lightdm
# use dbus-launch to launch the gstreamer command within the active dbus session
# the gstreamer command sets the given key to the special value 'nothing', which is the setting which
# should disable suspend when connected to a power source:
dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type \nothing
# to set the sleep time on battery to 30 minutes:
dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout \1800

To check your current settings:

# enter lightdm settings again (or don't exit and skip these 2 lines):
sudo su
su - -s /bin/bash lightdm
# number of seconds before AC timeout action (mine said 1200, only 20 minutes):
dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout
# what is the AC timeout action:
dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
# number of seconds before battery timeout action:
dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout
# what is the battery timeout action:
dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type

Alternatively you could set a longer ac timeout time instead of disabling suspend (3600s - 1 hour):

dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout \3600
0

Or you can install caffeine (available in the app center)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.