Difference between revisions of "Shutdown Pressing Power Button (简体中文)"

From ArchWiki
Jump to: navigation, search
m (moved 使用电源开关关闭系统 (简体中文) to Shutdown Pressing Power Button (简体中文): International naming standardization: Title in English (Lingua): User:Pointone/i18n)
(No difference)

Revision as of 02:44, 1 January 2010

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end 如果你想按下电源开关就可以关闭系统,可以按以下方法来做:

安装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.