Shutdown Pressing Power Button (简体中文)

From ArchWiki
Revision as of 01:34, 30 May 2008 by Zlowly (Talk | contribs)

Jump to: navigation, search

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Shutdown Pressing Power Button (简体中文)#)


安装acpid软件包,将acpid加入到rc.conf的DAEMONS队列中(并且/或者执行/etc/rc.d/acpid start),然后在/etc/acpi/events/中创建一个文件,内容如下:

# /etc/acpi/events/power
# This is called when the user presses the power button

event=button/power (PWR.||PBTN)

现在开始,按下电源开关(轻按,而不是长按几秒)就可以正常关闭系统了。 要注意,如果你已经正确配置好休眠(hibernate),你也许想将最后一行换为:




action=/opt/kde/bin/dcop --all-users --all-sessions ksmserver ksmserver logout 0 2 0


action=echo POWEROFF | /usr/lib/xfce4/xfsm-shutdown-helper

注意:要更稳健的解决方案[If you are facing frequent WM crashes or working on a sacrificial PC for developing or testing your software...],你可以参阅"/usr/src/linux/Documentation/sysrq.txt", which is a kernel facility for yielding you [the user...] the CPU so that it could be used for any *rescue* work.