我如何知道是什么阻止了 Ubuntu 睡眠?我的盒子不会自动睡眠!

我如何知道是什么阻止了 Ubuntu 睡眠?我的盒子不会自动睡眠!

通过菜单手动休眠 Ubuntu 桌面效果很好。我已将首选项设置为“不活动时暂停”并持续“5 分钟”。但计算机经常不休眠。

在 Windows 上,我使用它powercfg -requests来查看延迟的原因。在 Mac 上,我可以使用它pmset -g assertions来查看是什么阻止了睡眠 (来源)。

我认为 Chrome 可能正在阻止睡眠,但我不确定。

有没有 Linux 中类似的方法可以找到答案?动力顶可以这样使用吗?

14.04 LTS> gsettings list-recursively | grep plugins.power
org.gnome.settings-daemon.plugins.power button-power 'interactive'
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power percentage-low 10
org.gnome.settings-daemon.plugins.power priority 0
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false
org.gnome.settings-daemon.plugins.power idle-dim true
org.gnome.settings-daemon.plugins.power button-hibernate 'hibernate'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend'
org.gnome.settings-daemon.plugins.power button-sleep 'suspend'
org.gnome.settings-daemon.plugins.power button-suspend 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
org.gnome.settings-daemon.plugins.power time-low 1200
org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
org.gnome.settings-daemon.plugins.power notify-perhaps-recall true
org.gnome.settings-daemon.plugins.power percentage-critical 3
org.gnome.settings-daemon.plugins.power percentage-action 2
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power time-action 120
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 300
org.gnome.settings-daemon.plugins.power time-critical 300
org.gnome.settings-daemon.plugins.power active true
org.gnome.settings-daemon.plugins.power use-time-for-policy true
org.gnome.settings-daemon.plugins.power button-power 'interactive'
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power percentage-low 10
org.gnome.settings-daemon.plugins.power priority 0
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false
org.gnome.settings-daemon.plugins.power idle-dim true
org.gnome.settings-daemon.plugins.power button-hibernate 'hibernate'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend'
org.gnome.settings-daemon.plugins.power button-sleep 'suspend'
org.gnome.settings-daemon.plugins.power button-suspend 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
org.gnome.settings-daemon.plugins.power time-low 1200
org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
org.gnome.settings-daemon.plugins.power notify-perhaps-recall true
org.gnome.settings-daemon.plugins.power percentage-critical 3
org.gnome.settings-daemon.plugins.power percentage-action 2
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power time-action 120
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 300
org.gnome.settings-daemon.plugins.power time-critical 300
org.gnome.settings-daemon.plugins.power active true
org.gnome.settings-daemon.plugins.power use-time-for-policy true


cat /etc/default/acpi-support | grep SUSPEND_METHODS

SUSPEND_METHODS="dbus-pm dbus-hal pm-utils"

答案1

您需要找到抑制因素,也就是哪些进程阻止了您的暂停:

systemd-inhibit --list --mode=block

这将列出那些“不想睡觉”的进程

答案2

您必须设置:

  • 系统设置>电源设置为10分钟后关闭。
  • 系统设置>亮度和锁定,10 分钟后关闭屏幕。

对于电池和“插入电源时”:

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

您还可以设置:

org.gnome.settings-daemon.plugins.power sleep-display-battery设置为低于 sleep-inactive-battery-timeout

答案3

通过使用 xfce 桌面,单击电池任务栏图标显示它们 在此处输入图片描述

相关内容