The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 12,397β€…    Votes:  14β€…
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: April 8, 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'
⇧ help! W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_14.bin for module i915 Can't remove environmental variable in Ubuntu 18.04  β‡©