检查您的 /etc/systemd/logind.conf
文件。它应该如下所示:
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
取消注释那行写着
#HandlePowerKey=poweroff
的代码,并将值改为
ignore
。
然后使用命令
sudo systemctl restart systemd-logind
重新启动logind,或者重新启动您的计算机。
编辑:如何创建一个新的acpi处理程序
在
/etc/acpi/events/
中创建一个新文件。文件的内容应该是:
event=<acpi_event_code>
action=<script_to_call>
其中<acpi_event_code>
是使用acpi_listen
工具获取的代码,而<script_to_call>
是当事件发生时您希望调用的脚本的完整路径。
他们在13.10中肯定改变了一些东西,因为与13.04相比,我的/etc/accpi/events文件夹中的文件似乎太少了。
/etc/acpi/powerbtn.sh
文件,发现它什么都没做。 我所说的菜单可以通过命令gnome-session-quit --power-off
来召唤。 - Wauzl