You are not logged in.
Hi, whenever I view /var/log/acpi, I see that it logs my lid button status. When I try to add the monitor blank command to my /etc/apci/handler.sh script, though, it does not blank the monitor. Here is my handler.sh:
button/lid)
#echo "LID switched!">/dev/tty5
echo "LID switched!"
if grep open /proc/acpi/button/lid/LID/state; then
#lid opened
else
/usr/X11R6/bin/xset dpms force off
fi
;;
Is there another place I should put that monitoring code or should I modify it somehow?
Offline
This is just an idea.. Try changing the blanking line to this:
DISPLAY=:0 /usr/X11R6/bin/xset dpms force off
Ailen:
Kernel: Linux 2.6.14-rc4-ck1 #1 PREEMPT
Built on: Mon Oct 17 14:51:37 CEST 2005
Hardware: Mobile AMD Sempron(tm) Processor 2800+ AuthenticAMD
WM: E17 snapshot 20051016
Offline
This is just an idea.. Try changing the blanking line to this:
DISPLAY=:0 /usr/X11R6/bin/xset dpms force off
you have a point with that. However, the handler is going to be called as root, meaning you'll have to add "xhost +localhost" to allow any local user to access the x-server.
This, however, is a bad idea... but I guess it'd work... I just checked my handlers and they don't do any blanking, but my screen does blank when closed... maybe it's just my laptop hardware though.
Offline
I did as you said phrakture and now my logs say:
BEGIN HANDLER MESSAGES
/usr/X11R6/bin/xset: unable to open display " "
LID closed
I also tried it with DISPLAY=:0 and it said something to the effect of, "no DISPLAY=:0". Any other ideas? Thanks.
Offline
are you running X?
xset requires a running X server...
if not, you can use "setterm" to force the consoles off (something like setterm -powersave on, IIRC)
with X, you should run something like:
DISPLAY=:0.0
/usr/X11R6/bin/xhost +localhost
/usr/X11R6/bin/xset dpms force off
There's tons of information out on google... just search for "monitor blank acpi"
Offline
Yea I'm running Xorg. If I do 'xset dpms force off' on the command line, my monitor will blank. I've also tried those previous commands, handler.sh just can't seem to blank my monitor.
Offline
Yeah I'm trying to get the same behaviour too..
cept I have one problem.. I don't have the /proc/acpi/button/lid. I'm guessing that's the main reason why the handler hasn't been working..
I tried making a workaround I just added another event file into /etc/acpi to pass off the even to a script that checks xset info but that doesn't work neither
#!/bin/bash
if xset -q | grep -q "Monitor is On"
then
xset dpms force off
else
xset dpms force on
fi
but that hasn't work neither.. any ideas? the command entered through cmdline does work though..
Offline
I got it... I'm using a Dell Inspiron 5100 and apparently it has issues with ACPI.. I'm using the latest kernel so all you have to do is add the option "acpi_irq_balance" to ure bootloader and the it'll work... if you got an lower ver kernel you gotta patch it with a DSDT file and there's a how-to over at acpi.sourceforge.net
Offline
Could you reveal a little bit more details about your solution? I have kernel 2.6.12, do I need to patch anything into it? Did you use your pevious code in your own event file like you commented before or did you just edit handler.sh? Thanks.
Offline
are you using the same laptop as me? well in my case.. I'm using grub btw.. I just went to /boot/grub and added the option "acpi_irq_balance" to my bootloader file menu.lst
# (0) Arch Linux
title Arch Linux
root (hd0,2)
kernel /boot/vmlinuz26 root=/dev/discs/disc0/part3 ro acpi_irq_balance
then I restarted... and the inspiron will start updating events in the /proc/acpi/events file again (apparently it wasnt doing that before)
again this was for my laptop... I wouldn't know if this would work for yours or even if the DSDT table update would.. you'd have to do some more reading over at acpi.sourceforge.net
EDIT: oh fergot... the acpid handler script worked fine afterwards, as did the one I wrote.. the root problem was the events file wasn't updated not the scripts themselves
Offline
bam!
http://web.utk.edu/~rmahurin/inspiron51 … 0000000000
This script forces x off in a much more elegant way compared to the ones posted here.
Offline
Wow, crazy, that worked. Thanks man.
Offline