Answers:
这很简单。当您按下电源按钮时,ACPI事件将在触发脚本/etc/acpi/powerbtn.sh
。
您可以对其进行编辑以shutdown -h now
使其首先运行,如下所示:
#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.
/sbin/shutdown -h now "Power button pressed"
exit 0
# leave the old code below (in case you want to revert!)