20.04 - 在Ubuntu 20 LTS上,如何禁用电源按钮的行为

分享于 

4分钟阅读

ubuntu

  繁體

问题:

在将ubuntu从18LTS升级到20LTS之后,禁用的电源按钮行为不再起作用,

以下是当前设置gsettings list-recursively org.gnome.settings-daemon.plugins.power


org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'


org.gnome.settings-daemon.plugins.power time-critical 300


org.gnome.settings-daemon.plugins.power power-button-action 'nothing'


org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false


org.gnome.settings-daemon.plugins.power button-hibernate 'nothing'


org.gnome.settings-daemon.plugins.power idle-dim true


org.gnome.settings-daemon.plugins.power button-power 'nothing'


org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'


org.gnome.settings-daemon.plugins.power priority 0


org.gnome.settings-daemon.plugins.power idle-brightness 30


org.gnome.settings-daemon.plugins.power active true


org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'


org.gnome.settings-daemon.plugins.power button-suspend 'nothing'


org.gnome.settings-daemon.plugins.power button-sleep 'nothing'


org.gnome.settings-daemon.plugins.power percentage-critical 3


org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 3600


org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'


org.gnome.settings-daemon.plugins.power ambient-enabled true


org.gnome.settings-daemon.plugins.power notify-perhaps-recall true


org.gnome.settings-daemon.plugins.power percentage-low 10


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-low 1200


org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 1200


org.gnome.settings-daemon.plugins.power time-action 120


org.gnome.settings-daemon.plugins.power use-time-for-policy true



cat /etc/systemd/logind.conf


[Login]


#NAutoVTs=6


#ReserveVT=6


#KillUserProcesses=no


#KillOnlyUsers=


#KillExcludeUsers=root


#InhibitDelayMaxSec=5


HandlePowerKey=ignore


HandleSuspendKey=ignore


HandleHibernateKey=ignore


#HandleLidSwitch=suspend


#HandleLidSwitchDocked=ignore


#PowerKeyIgnoreInhibited=no


#SuspendKeyIgnoreInhibited=no


#HibernateKeyIgnoreInhibited=no


#LidSwitchIgnoreInhibited=yes


#HoldoffTimeoutSec=30s


#IdleAction=ignore


#IdleActionSec=30min


#RuntimeDirectorySize=10%


#RemoveIPC=yes


#InhibitorsMax=8192


#SessionsMax=8192


#UserTasksMax=33%




答案1:

在Ubuntu 20.04 LTS控制面板中,在"电源按钮行为"下拉菜单中可以选择使电源按钮"不执行任何操作"。


答案2:

com.canonical.unity.settings-daemon.plugins.power或者org.mate.power-manager

gsettings list-recursively | grep button


POW  Ubuntu  按钮  behaviour