Lubuntu - 电源按钮无法关闭计算机。

我正在使用 Lubuntu 13.04,并希望按下电源按钮时可以关闭计算机。目前它只会打开电源偏好菜单(注销、重启、休眠等等)。

在 Lubuntu 中,有 xfce4-power-manager v1.2 ,我尝试通过设置 常规->按下电源按钮时->关闭 选项来修复它,但这没有改变任何东西。

非常感谢任何帮助。

2个回答

试试这个。编辑/etc/acpi/powerbtn.sh,然后确保以下行是它的最后几行。
# If all else failed, just initiate a plain shutdown.
/sbin/shutdown -h now "Power button pressed"

还要查看/etc/acpi/events/powerbtn,并确保与下面的内容匹配,特别是最后一部分。
# /etc/acpi/events/powerbtn
# This is called when the user presses the power button and calls
# /etc/acpi/powerbtn.sh for further processing.

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

# We need to react on "button power.*" and "button/power.*" because
# of kernel changes.

event=button[ /]power
action=/etc/acpi/powerbtn.sh

如果你做了任何更改,请确保在尝试查看是否有效之前运行。你可能需要重新启动。
sudo service acpid restart

很抱歉,没有acpid服务(并且目录/etc/acpi不存在)。 - cloying
1@cloying 你可以使用 sudo apt-get install acpid 命令来安装 acpid。 - Glutanimate
抱歉耽搁了,但是我想说安装了acpid之后,这个方法对我有效。我已将问题标记为已解答。 - cloying


欢迎来到Ask Ubuntu!这个问题是如何让电源按钮直接关机的呢?请列出你所遵循的所有步骤,以使电源按钮能够直接关机。 - Alaa Ali