Machine: Compaq Evo N1015v with kernel26 126.96.36.199-1
I installed acpid to use acpi stuff..
acpid made /etc/acpi/handler.sh script..
I get the proper event registered to /var/log/acpid when I close lid..
Here is what I'm tyring to do:
#!/bin/sh # Default acpi script that takes an entry for all actions # NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to # modify it to not use /sys minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq` maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed" set $* case "$1" in button/lid) #echo "LID switched!">/dev/tty5 echo "LID switched!" /usr/X11R6/bin/xset dpms force off ;; *) logger "ACPI group/action undefined: $1 / $2" ;; esac
Above forces off the screen when button/lid event is registered (both open and closed)..
Question 1: How do I make a different action to be taken when the lid is closed and when the lid is opened?? I want the screen to be offed as long as the lid is closed, even though I move mouse while the lid is closed..
Question 2: when I look at the log file, it says "/usr/X11R6/bin/xset: unable to open display "" "
I can log in as root and manually execute xset command ...but I don't know why I'm getting that error message..
Question 3: for battery, I read gentoo document and it said making battery runlevel (and other runlevels) is good way to use acpi, but how do I make new runlevels in arch? is there an arch way of doing acpi properly?
Basically, I want to suspend to disk when I'm running on battery AND battery juice is almost out...(i'll never hibernate when I'm running on ac adapter)..
if grep open /proc/acpi/button/lid/LID/state; then #lid opened else #lid closed fi
2) try using "DISPLAY=:0 /usr/X11R6/bin/xset dpms force off"
3) dunno - they probably suggest using a run level so that system daemons can be shutoff when on battery (who want's apache running when on battery power)
I'd say just add the service calls manually for now, i.e. call /etc/rc.d/httpd stop on battery, and start on ac...