2025年10月29日 星期三

Prevent Debian from suspend

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

 

sudo nano /etc/systemd/sleep.conf.d/nosuspend.conf

[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no


gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0


sudo nano /etc/systemd/logind.conf

[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore


https://unix.stackexchange.com/questions/748759/disabling-suspend-etc-on-debian-12


/etc/gdm3/greeter.dconf-defaults

# Automatic suspend
# =================
[org/gnome/settings-daemon/plugins/power]
# - Time inactive in seconds before suspending with AC power
#   1200=20 minutes, 0=never
# sleep-inactive-ac-timeout=1200
# - What to do after sleep-inactive-ac-timeout
#   'blank', 'suspend', 'shutdown', 'hibernate', 'interactive' or 'nothing'
sleep-inactive-ac-type='blank'
# - As above but when on battery
# sleep-inactive-battery-timeout=1200
# sleep-inactive-battery-type='suspend'

 

沒有留言: