Views:
13,302β
Votes: 15β
Tags:
18.04
suspend
power-management
hibernate
Link:
π See Original Answer on Ask Ubuntu β§ π
URL:
https://askubuntu.com/q/1132068
Title:
Prevent sleep/suspend when not logged in to a specific account
ID:
/2019/04/08/Prevent-sleep_suspend-when-not-logged-in-to-a-specific-account
Created:
April 8, 2019
Edited: June 12, 2020
Upload:
September 15, 2024
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
When no user is signed on
When no user is signed on the power settings come from psuedo-user ID gdm
. The following controls for GDM auto-suspend come from: ArchLinux GDM
GDM auto-suspend (GNOME 3.28)
GDM uses a separate dconf database to control power management. You can make GDM behave the same way as user sessions by copying the user settings to GDMβs dconf database.
$ IFS=$'\n'; for x in $(sudo -u username gsettings list-recursively org.gnome.settings-daemon.plugins.power); do eval "sudo -u gdm dbus-launch gsettings set $x"; done; unset IFS
where username
is your userβs name.
Or to simply disable auto-suspend (also run the command with ac replaced with battery to also disable it while running on battery):
$ sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'