|
我是这样设制的, 可是当我按Fn F3时,仅发生了“gnome-power-manager图标*出了电池充电状态的信息“。请问这是怎么回事?谢谢- # nano -w /etc/acpi/events/sleepbtn
- event=ibm/hotkey HKEY 00000080 00001003
- action=/etc/acpi/actions/sleepbtn.sh
- # nano -w /etc/acpi/actions/sleepbtn.sh
- #!/bin/bash
- # simple script to turn the display on or off #
- # By Mahram Z.Foadi #
- # Oct 22 2005 #
- # thank you linuxquestions.org #
- # #
- # the following lines must be present in your "/etc/acpi/events/" files. Some #
- # systems already have a file called sample.conf in the mentioned directory #
- # rename it to something more meaningful (i.e. acpid.conf) and these lines to #
- # the end of it (you don't HAVE to rename it, you can even create a new file #
- # and call it /etc/acpi/events/lid.conf with the 2 lines in it. If you intend #
- # to put this file anywhere other than /sbin/lidevent, make sure you make the #
- # proper changes in the "action" line below. For example if you are going to #
- # save this script as /usr/bin/mylid.sh then the action line should be: #
- # action=/usr/bin/mylid.sh #
- # be sure both files are executable, writable, and owned by root ONLY because #
- # the acpid daemon is most likely running as root in your system #
- # #
- # ---- insert the two lines below in /etc/acpi/events/acpid.conf ---- #
- # event=button/lid.* #
- # action=/sbin/lidevent #
- #------------------------------------------------------------------------------------------------------------------#
- # default display on current host
- DISPLAY=:0.0
- # find out if DPMS is enabled
- STATUS=`xset -display $DISPLAY -q | grep -e 'DPMS is'`
- # enable DPMS if disabled
- if [ "$STATUS" == " DPMS is Disabled" ]
- then
- echo "Enabling DPMS ..."
- xset -display $DISPLAY +dpms
- fi
- # find out if monitor is on
- STATUS=`xset -display $DISPLAY -q | grep 'Monitor'`
- if [ "$STATUS" == " Monitor is On" ]
- then
- echo "[`date`] Turning display OFF"
- xset -display $DISPLAY dpms force off
- else
- echo "[`date`] Turning display ON" # shows up in log
- xset -display $DISPLAY dpms force on # turn monitor on
- xset -display $DISPLAY s activate # un-blank monitor
- fi
- #clean up
- unset STATUS
- # comment this line out if you're manually running this script from a shell (put a # in front of it)
- unset DISPLAY
- exit 0
- # chmod a+x /etc/acpi/actions/sleepbtn.sh
- # nano /etc/conf.d/local.start
- 加入 xhost +local:root
复制代码 |
|