Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Turning of lcd when lid closes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
spqrdecker
n00b
n00b


Joined: 15 Nov 2004
Posts: 34
Location: Charlottesville, Va.

PostPosted: Mon Dec 27, 2004 4:06 am    Post subject: Turning of lcd when lid closes Reply with quote

I am trying to make my laptop turn off its lcd (esp. the backlight) whenever I close the lid. I can figure out how to make it hibernate (or do whatever...) because lid cloure is an event that acpi can recognize (discussed elshwhere in forum: https://forums.gentoo.org/viewtopic.php?t=265109&highlight=lid) I just can't figure out how to make the lcd turn off (not just go blank), whenever I close the lid. Making it hibernate is useless, becuase I want music to keep playing, stuff to keep compiling, etc. I just don't want to have to waste battery power on a screen nobody can see. Any ideas?
Back to top
View user's profile Send private message
Jake
Veteran
Veteran


Joined: 31 Jul 2003
Posts: 1132

PostPosted: Mon Dec 27, 2004 4:59 am    Post subject: Reply with quote

I use the Xorg radeon driver for my Compaq N800w and have the following:
Code:
$ cat /etc/acpi/lid.sh
#!/bin/sh
grep -r open /proc/acpi/button/lid > /dev/null
if [ $? -eq 0 ]; then
        /usr/bin/radeontool light on
else
        /usr/bin/radeontool light off
fi

$ cat /etc/acpi/events/lid
event=button[ /]lid
action=/etc/acpi/lid.sh
Back to top
View user's profile Send private message
spqrdecker
n00b
n00b


Joined: 15 Nov 2004
Posts: 34
Location: Charlottesville, Va.

PostPosted: Mon Dec 27, 2004 5:20 am    Post subject: Reply with quote

I am also using the Xorg radeon driver (open source, not ati's), but I don't have 'radeontool'. After a quick search, I found its ebuild and I shall try it and report back. Thank you.
Back to top
View user's profile Send private message
spqrdecker
n00b
n00b


Joined: 15 Nov 2004
Posts: 34
Location: Charlottesville, Va.

PostPosted: Mon Dec 27, 2004 6:12 am    Post subject: Reply with quote

Okay, the radeontool works fine from the command line. Now, I can't get acpid to recognize lid closure as an event (I checked in /var/log/acpid). What gives?
Back to top
View user's profile Send private message
Jake
Veteran
Veteran


Joined: 31 Jul 2003
Posts: 1132

PostPosted: Mon Dec 27, 2004 6:47 am    Post subject: Reply with quote

Does "/proc/acpi/button/lid/C136/state" change when you press the button? "C136" might be different in your path. If it doesn't change in /proc, the kernel doesn't know about your lid switch, so either you missed an option in the config, or it isn't supported. If it isn't supported, ATI's proprietary drivers might still work.
Back to top
View user's profile Send private message
spqrdecker
n00b
n00b


Joined: 15 Nov 2004
Posts: 34
Location: Charlottesville, Va.

PostPosted: Mon Dec 27, 2004 7:01 am    Post subject: Reply with quote

What button? It's my lid. And yes, I've tried looking in /proc/acpi/button/lid/LID/state, but I can't tell if it changes when I close it because I can't read the screen with the lid closed.
Back to top
View user's profile Send private message
Jengu
Guru
Guru


Joined: 28 Oct 2004
Posts: 384

PostPosted: Mon Dec 27, 2004 7:06 am    Post subject: Reply with quote

On my laptop, if I have the DPMS option on in my xorg.conf and acpi in my kernel, all I have to do is close the lid and wait fifteen seconds and it turns off. Check to make sure that it isn't just taking while to switch off. I haven't messed with any power management config files at all it does this.
Back to top
View user's profile Send private message
spqrdecker
n00b
n00b


Joined: 15 Nov 2004
Posts: 34
Location: Charlottesville, Va.

PostPosted: Mon Dec 27, 2004 7:22 am    Post subject: Reply with quote

I have both DPMS enabled in xorg.conf as well as ACPI compiled into the kernel, but I can not seem to get this to work, no matter how long I wait. But I am out of ideas...
Back to top
View user's profile Send private message
Jake
Veteran
Veteran


Joined: 31 Jul 2003
Posts: 1132

PostPosted: Mon Dec 27, 2004 8:27 am    Post subject: Reply with quote

spqrdecker wrote:
What button? It's my lid. And yes, I've tried looking in /proc/acpi/button/lid/LID/state, but I can't tell if it changes when I close it because I can't read the screen with the lid closed.

On my laptop, the lid hits a little button. I can press the button without closing the lid. I thought most laptops worked that way. Alternativley, run the command "sleep 5 ; cat /proc/acpi/button/lid/LID/state" and you'll have 5 seconds to close the lid before cat reads the state file in proc.

If you're sure you have the right kernel options, try the ati-drivers. They should "just work" with the lid switch, no ACPI configuration required.
Back to top
View user's profile Send private message
spqrdecker
n00b
n00b


Joined: 15 Nov 2004
Posts: 34
Location: Charlottesville, Va.

PostPosted: Mon Dec 27, 2004 9:14 am    Post subject: Reply with quote

Thanks for the sleep 5 idea! It proved what I had been suspecting: there is no way for my laptop to know it's closed. And no, there isn't a button (I'm assuming it would be a smaller version of what one finds in a washing machine), but there should be. Thank you for all of your help, but I think that my problem has nothing to do with software config, but with the fact that my low-end Dell was not built with that little button.

As a short post-script, I've tried the ati-drivers. While they can do some serious eye-candy GL magic, they generally stink otherwise, esp. on fullscreen video (they can't use the Xv extension). And they didn't make the lid blank the lcd when it closed either, because, "Dude I got a Dell".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum