* [gentoo-user] Laptop Lid Close... @ 2009-01-23 1:24 BRM 2009-01-23 7:14 ` Joshua Murphy 0 siblings, 1 reply; 9+ messages in thread From: BRM @ 2009-01-23 1:24 UTC (permalink / raw To: Users Gentoo I'm running a Dell D600, and I've located a number of tools for it but I am not seeing anything related to when I close the lid. Since I got Gentoo running on it, the Monitor continues running when I close the lid. I've found several sources for doing something as an ACPI event, which seems to be the right method. I can toggle the button with the lid open and cat /etc/acpi/button/lid/LID/state and see it change between 'open' and 'closed'; and I know I could write myself a little script do something like calling radeontool to turn off the backlight, but I'd like to find a more official method. I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes out and all), but I didn't see anything for a 'turn off monitor on lid close' setting (preferrably root controlled so that it affects all users). The only thing I can find is a the standby/suspend/shutdown/logoff, system performance, and CPU throttling. I don't really want to do any of that - just put the monitor into stand-by, not necessarily the whole system. Any how...I'd really like to get this working. TIA, Ben ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Laptop Lid Close... 2009-01-23 1:24 [gentoo-user] Laptop Lid Close BRM @ 2009-01-23 7:14 ` Joshua Murphy 2009-01-23 14:57 ` Gregory SACRE 2009-01-24 16:21 ` Brandon Vargo 0 siblings, 2 replies; 9+ messages in thread From: Joshua Murphy @ 2009-01-23 7:14 UTC (permalink / raw To: gentoo-user On Thu, Jan 22, 2009 at 8:24 PM, BRM <bm_witness@yahoo.com> wrote: > I'm running a Dell D600, and I've located a number of tools for it but I am not seeing anything related to when I close the lid. Since I got Gentoo running on it, the Monitor continues running when I close the lid. > > I've found several sources for doing something as an ACPI event, which seems to be the right method. I can toggle the button with the lid open and cat /etc/acpi/button/lid/LID/state and see it change between 'open' and 'closed'; and I know I could write myself a little script do something like calling radeontool to turn off the backlight, but I'd like to find a more official method. > > I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes out and all), but I didn't see anything for a 'turn off monitor on lid close' setting (preferrably root controlled so that it affects all users). The only thing I can find is a the standby/suspend/shutdown/logoff, system performance, and CPU throttling. I don't really want to do any of that - just put the monitor into stand-by, not necessarily the whole system. > > Any how...I'd really like to get this working. > > TIA, > > Ben In... /etc/acpi/default.sh there's a comment (with commented code you can use following it)... # if your laptop doesnt turn on/off the display via hardware # switch and instead just generates an acpi event, you can force # X to turn off the display via dpms. note you will have to run # 'xhost +local:0' so root can access the X DISPLAY. if radeontool or something will allow you to disable the display even when you aren't in X, or without proper access to the display (like xset requires) you might be able to even escape needing that xhost setting. No way of testing it at all myself though. -- Poison [BLX] Joshua M. Murphy ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Laptop Lid Close... 2009-01-23 7:14 ` Joshua Murphy @ 2009-01-23 14:57 ` Gregory SACRE 2009-01-24 3:58 ` BRM 2009-01-24 16:21 ` Brandon Vargo 1 sibling, 1 reply; 9+ messages in thread From: Gregory SACRE @ 2009-01-23 14:57 UTC (permalink / raw To: gentoo-user This is the script I am using. It is spawned by the default.sh from /etc/acpi: -------------------------- SCRIPT START -------------------------- # default display on current host export XAUTHORITY="/home/<your_user>/.Xauthority" DISPLAY=:0.0 # find out if monitor is on STATUS=`cat /proc/acpi/button/lid/LID0/state` logger "monitor: $STATUS" # find out if DPMS is enabled DPMS=`xset -display $DISPLAY -q | grep -e 'DPMS is'` logger "dpms: $DPMS" # enable DPMS if disabled if [ "$DPMS" == " DPMS is Disabled" ] then logger "Enabling DPMS ..." xset -display $DISPLAY +dpms fi if [ `echo $STATUS | grep -i closed | wc -l` -eq 1 ] then logger "[`date`] Turning display OFF" xset -display $DISPLAY dpms force off else logger "[`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 unset DPMS # comment this line out if you're manually running this script from a shell (put a # in front of it) unset DISPLAY exit 0 -------------------------- SCRIPT STOP -------------------------- Change the <your_user> variable. I had also to set xscreensaver to switch off my monitor instead of blanking it, because I think (not sure) that xscreensaver was switching on my monitor when it was supposed to start the screensaver (as after a while, my monitor was switched back on, and as I didn't see that happening since my xscreensaver modification, I can only assume that was the problem). HTH, Greg On Fri, Jan 23, 2009 at 8:14 AM, Joshua Murphy <poisonbl@gmail.com> wrote: > On Thu, Jan 22, 2009 at 8:24 PM, BRM <bm_witness@yahoo.com> wrote: >> I'm running a Dell D600, and I've located a number of tools for it but I am not seeing anything related to when I close the lid. Since I got Gentoo running on it, the Monitor continues running when I close the lid. >> >> I've found several sources for doing something as an ACPI event, which seems to be the right method. I can toggle the button with the lid open and cat /etc/acpi/button/lid/LID/state and see it change between 'open' and 'closed'; and I know I could write myself a little script do something like calling radeontool to turn off the backlight, but I'd like to find a more official method. >> >> I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes out and all), but I didn't see anything for a 'turn off monitor on lid close' setting (preferrably root controlled so that it affects all users). The only thing I can find is a the standby/suspend/shutdown/logoff, system performance, and CPU throttling. I don't really want to do any of that - just put the monitor into stand-by, not necessarily the whole system. >> >> Any how...I'd really like to get this working. >> >> TIA, >> >> Ben > > In... > /etc/acpi/default.sh > > there's a comment (with commented code you can use following it)... > # if your laptop doesnt turn on/off the display via hardware > # switch and instead just generates an acpi event, you can force > # X to turn off the display via dpms. note you will have to run > # 'xhost +local:0' so root can access the X DISPLAY. > > if radeontool or something will allow you to disable the display even > when you aren't in X, or without proper access to the display (like > xset requires) you might be able to even escape needing that xhost > setting. No way of testing it at all myself though. > > -- > Poison [BLX] > Joshua M. Murphy > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Laptop Lid Close... 2009-01-23 14:57 ` Gregory SACRE @ 2009-01-24 3:58 ` BRM 2009-01-26 16:32 ` Gregory SACRE 0 siblings, 1 reply; 9+ messages in thread From: BRM @ 2009-01-24 3:58 UTC (permalink / raw To: gentoo-user For some reason, the script is not getting called when I press the button. That is not to say that the system doesn't recognize it - if I set KDE to put the system in stand-by when the lid is closed, it very well will. But as I said earlier, that's not what I want - I just want to turn on/off the monitor. I know kacpid is running...but I don't think acpid is...at least, when I tried /etc/init.d/acpid start it complained: * Starting acpid ... acpid: can't open /proc/acpi/event: Device or resource busy Ben ----- Original Message ---- From: Gregory SACRE <gregory.sacre@gmail.com> To: gentoo-user@lists.gentoo.org Sent: Friday, January 23, 2009 2:57:31 PM Subject: Re: [gentoo-user] Laptop Lid Close... This is the script I am using. It is spawned by the default.sh from /etc/acpi: -------------------------- SCRIPT START -------------------------- # default display on current host export XAUTHORITY="/home/<your_user>/.Xauthority" DISPLAY=:0.0 # find out if monitor is on STATUS=`cat /proc/acpi/button/lid/LID0/state` logger "monitor: $STATUS" # find out if DPMS is enabled DPMS=`xset -display $DISPLAY -q | grep -e 'DPMS is'` logger "dpms: $DPMS" # enable DPMS if disabled if [ "$DPMS" == " DPMS is Disabled" ] then logger "Enabling DPMS ..." xset -display $DISPLAY +dpms fi if [ `echo $STATUS | grep -i closed | wc -l` -eq 1 ] then logger "[`date`] Turning display OFF" xset -display $DISPLAY dpms force off else logger "[`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 unset DPMS # comment this line out if you're manually running this script from a shell (put a # in front of it) unset DISPLAY exit 0 -------------------------- SCRIPT STOP -------------------------- Change the <your_user> variable. I had also to set xscreensaver to switch off my monitor instead of blanking it, because I think (not sure) that xscreensaver was switching on my monitor when it was supposed to start the screensaver (as after a while, my monitor was switched back on, and as I didn't see that happening since my xscreensaver modification, I can only assume that was the problem). HTH, Greg On Fri, Jan 23, 2009 at 8:14 AM, Joshua Murphy <poisonbl@gmail.com> wrote: > On Thu, Jan 22, 2009 at 8:24 PM, BRM <bm_witness@yahoo.com> wrote: >> I'm running a Dell D600, and I've located a number of tools for it but I am not seeing anything related to when I close the lid. Since I got Gentoo running on it, the Monitor continues running when I close the lid. >> >> I've found several sources for doing something as an ACPI event, which seems to be the right method. I can toggle the button with the lid open and cat /etc/acpi/button/lid/LID/state and see it change between 'open' and 'closed'; and I know I could write myself a little script do something like calling radeontool to turn off the backlight, but I'd like to find a more official method. >> >> I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes out and all), but I didn't see anything for a 'turn off monitor on lid close' setting (preferrably root controlled so that it affects all users). The only thing I can find is a the standby/suspend/shutdown/logoff, system performance, and CPU throttling. I don't really want to do any of that - just put the monitor into stand-by, not necessarily the whole system. >> >> Any how...I'd really like to get this working. >> >> TIA, >> >> Ben > > In... > /etc/acpi/default.sh > > there's a comment (with commented code you can use following it)... > # if your laptop doesnt turn on/off the display via hardware > # switch and instead just generates an acpi event, you can force > # X to turn off the display via dpms. note you will have to run > # 'xhost +local:0' so root can access the X DISPLAY. > > if radeontool or something will allow you to disable the display even > when you aren't in X, or without proper access to the display (like > xset requires) you might be able to even escape needing that xhost > setting. No way of testing it at all myself though. > > -- > Poison [BLX] > Joshua M. Murphy > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Laptop Lid Close... 2009-01-24 3:58 ` BRM @ 2009-01-26 16:32 ` Gregory SACRE 2009-01-26 17:59 ` BRM 0 siblings, 1 reply; 9+ messages in thread From: Gregory SACRE @ 2009-01-26 16:32 UTC (permalink / raw To: gentoo-user I've googled a bit and found these two things: [1] http://bugs.gentoo.org/175464 [2] https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/51591 They both refer to problems with hald and acpid entering in conflict. Check if you are using hald. If you are, try stopping it and starting acpid to see if it still gives you the problem. Concerning the fact that the script isn't called, you have to check in your /etc/acpi/event/default. Make sure that you have lines such as: event=.* action=/etc/acpi/default.sh %e Basically, it says that for any event handled by acpi, launch /etc/acpi/default.sh. And in /etc/acpi/default.sh, check for the "lid" event. It should look like this: [...] case "$group" in [...] lid) /etc/acpi/screen_off.sh > /tmp/screen_off 2>&1 [...] where screen_off.sh is the script I sent you in my previous mail. HTH, Greg On Sat, Jan 24, 2009 at 4:58 AM, BRM <bm_witness@yahoo.com> wrote: > For some reason, the script is not getting called when I press the button. > > That is not to say that the system doesn't recognize it - if I set KDE to put the system in stand-by when the lid is closed, it very well will. But as I said earlier, that's not what I want - I just want to turn on/off the monitor. > > I know kacpid is running...but I don't think acpid is...at least, when I tried /etc/init.d/acpid start it complained: > > * Starting acpid ... > acpid: can't open /proc/acpi/event: Device or resource busy > > Ben > > > > ----- Original Message ---- > From: Gregory SACRE <gregory.sacre@gmail.com> > To: gentoo-user@lists.gentoo.org > Sent: Friday, January 23, 2009 2:57:31 PM > Subject: Re: [gentoo-user] Laptop Lid Close... > > This is the script I am using. It is spawned by the default.sh from /etc/acpi: > > -------------------------- SCRIPT START -------------------------- > # default display on current host > export XAUTHORITY="/home/<your_user>/.Xauthority" > DISPLAY=:0.0 > > # find out if monitor is on > STATUS=`cat /proc/acpi/button/lid/LID0/state` > logger "monitor: $STATUS" > > # find out if DPMS is enabled > DPMS=`xset -display $DISPLAY -q | grep -e 'DPMS is'` > logger "dpms: $DPMS" > > # enable DPMS if disabled > if [ "$DPMS" == " DPMS is Disabled" ] > then > logger "Enabling DPMS ..." > xset -display $DISPLAY +dpms > fi > > if [ `echo $STATUS | grep -i closed | wc -l` -eq 1 ] > then > logger "[`date`] Turning display OFF" > xset -display $DISPLAY dpms force off > else > logger "[`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 > unset DPMS > > # comment this line out if you're manually running this script from a > shell (put a # in front of it) > unset DISPLAY > > exit 0 > -------------------------- SCRIPT STOP -------------------------- > > Change the <your_user> variable. > I had also to set xscreensaver to switch off my monitor instead of > blanking it, because I think (not sure) that xscreensaver was > switching on my monitor when it was supposed to start the screensaver > (as after a while, my monitor was switched back on, and as I didn't > see that happening since my xscreensaver modification, I can only > assume that was the problem). > > > HTH, > > Greg > > > On Fri, Jan 23, 2009 at 8:14 AM, Joshua Murphy <poisonbl@gmail.com> wrote: >> On Thu, Jan 22, 2009 at 8:24 PM, BRM <bm_witness@yahoo.com> wrote: >>> I'm running a Dell D600, and I've located a number of tools for it but I am not seeing anything related to when I close the lid. Since I got Gentoo running on it, the Monitor continues running when I close the lid. >>> >>> I've found several sources for doing something as an ACPI event, which seems to be the right method. I can toggle the button with the lid open and cat /etc/acpi/button/lid/LID/state and see it change between 'open' and 'closed'; and I know I could write myself a little script do something like calling radeontool to turn off the backlight, but I'd like to find a more official method. >>> >>> I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes out and all), but I didn't see anything for a 'turn off monitor on lid close' setting (preferrably root controlled so that it affects all users). The only thing I can find is a the standby/suspend/shutdown/logoff, system performance, and CPU throttling. I don't really want to do any of that - just put the monitor into stand-by, not necessarily the whole system. >>> >>> Any how...I'd really like to get this working. >>> >>> TIA, >>> >>> Ben >> >> In... >> /etc/acpi/default.sh >> >> there's a comment (with commented code you can use following it)... >> # if your laptop doesnt turn on/off the display via hardware >> # switch and instead just generates an acpi event, you can force >> # X to turn off the display via dpms. note you will have to run >> # 'xhost +local:0' so root can access the X DISPLAY. >> >> if radeontool or something will allow you to disable the display even >> when you aren't in X, or without proper access to the display (like >> xset requires) you might be able to even escape needing that xhost >> setting. No way of testing it at all myself though. >> >> -- >> Poison [BLX] >> Joshua M. Murphy >> >> > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Laptop Lid Close... 2009-01-26 16:32 ` Gregory SACRE @ 2009-01-26 17:59 ` BRM 2009-01-29 15:50 ` BRM 0 siblings, 1 reply; 9+ messages in thread From: BRM @ 2009-01-26 17:59 UTC (permalink / raw To: gentoo-user Cool. Thanks. That looks like it should solve the issue. Ben ----- Original Message ---- From: Gregory SACRE <gregory.sacre@gmail.com> To: gentoo-user@lists.gentoo.org Sent: Monday, January 26, 2009 11:32:32 AM Subject: Re: [gentoo-user] Laptop Lid Close... I've googled a bit and found these two things: [1] http://bugs.gentoo.org/175464 [2] https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/51591 They both refer to problems with hald and acpid entering in conflict. Check if you are using hald. If you are, try stopping it and starting acpid to see if it still gives you the problem. Concerning the fact that the script isn't called, you have to check in your /etc/acpi/event/default. Make sure that you have lines such as: event=.* action=/etc/acpi/default.sh %e Basically, it says that for any event handled by acpi, launch /etc/acpi/default.sh. And in /etc/acpi/default.sh, check for the "lid" event. It should look like this: [...] case "$group" in [...] lid) /etc/acpi/screen_off.sh > /tmp/screen_off 2>&1 [...] where screen_off.sh is the script I sent you in my previous mail. HTH, Greg On Sat, Jan 24, 2009 at 4:58 AM, BRM <bm_witness@yahoo.com> wrote: > For some reason, the script is not getting called when I press the button. > > That is not to say that the system doesn't recognize it - if I set KDE to put the system in stand-by when the lid is closed, it very well will. But as I said earlier, that's not what I want - I just want to turn on/off the monitor. > > I know kacpid is running...but I don't think acpid is...at least, when I tried /etc/init.d/acpid start it complained: > > * Starting acpid ... > acpid: can't open /proc/acpi/event: Device or resource busy > > Ben > > > > ----- Original Message ---- > From: Gregory SACRE <gregory.sacre@gmail.com> > To: gentoo-user@lists.gentoo.org > Sent: Friday, January 23, 2009 2:57:31 PM > Subject: Re: [gentoo-user] Laptop Lid Close... > > This is the script I am using. It is spawned by the default.sh from /etc/acpi: > > -------------------------- SCRIPT START -------------------------- > # default display on current host > export XAUTHORITY="/home/<your_user>/.Xauthority" > DISPLAY=:0.0 > > # find out if monitor is on > STATUS=`cat /proc/acpi/button/lid/LID0/state` > logger "monitor: $STATUS" > > # find out if DPMS is enabled > DPMS=`xset -display $DISPLAY -q | grep -e 'DPMS is'` > logger "dpms: $DPMS" > > # enable DPMS if disabled > if [ "$DPMS" == " DPMS is Disabled" ] > then > logger "Enabling DPMS ..." > xset -display $DISPLAY +dpms > fi > > if [ `echo $STATUS | grep -i closed | wc -l` -eq 1 ] > then > logger "[`date`] Turning display OFF" > xset -display $DISPLAY dpms force off > else > logger "[`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 > unset DPMS > > # comment this line out if you're manually running this script from a > shell (put a # in front of it) > unset DISPLAY > > exit 0 > -------------------------- SCRIPT STOP -------------------------- > > Change the <your_user> variable. > I had also to set xscreensaver to switch off my monitor instead of > blanking it, because I think (not sure) that xscreensaver was > switching on my monitor when it was supposed to start the screensaver > (as after a while, my monitor was switched back on, and as I didn't > see that happening since my xscreensaver modification, I can only > assume that was the problem). > > > HTH, > > Greg > > > On Fri, Jan 23, 2009 at 8:14 AM, Joshua Murphy <poisonbl@gmail.com> wrote: >> On Thu, Jan 22, 2009 at 8:24 PM, BRM <bm_witness@yahoo.com> wrote: >>> I'm running a Dell D600, and I've located a number of tools for it but I am not seeing anything related to when I close the lid. Since I got Gentoo running on it, the Monitor continues running when I close the lid. >>> >>> I've found several sources for doing something as an ACPI event, which seems to be the right method. I can toggle the button with the lid open and cat /etc/acpi/button/lid/LID/state and see it change between 'open' and 'closed'; and I know I could write myself a little script do something like calling radeontool to turn off the backlight, but I'd like to find a more official method. >>> >>> I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes out and all), but I didn't see anything for a 'turn off monitor on lid close' setting (preferrably root controlled so that it affects all users). The only thing I can find is a the standby/suspend/shutdown/logoff, system performance, and CPU throttling. I don't really want to do any of that - just put the monitor into stand-by, not necessarily the whole system. >>> >>> Any how...I'd really like to get this working. >>> >>> TIA, >>> >>> Ben >> >> In... >> /etc/acpi/default.sh >> >> there's a comment (with commented code you can use following it)... >> # if your laptop doesnt turn on/off the display via hardware >> # switch and instead just generates an acpi event, you can force >> # X to turn off the display via dpms. note you will have to run >> # 'xhost +local:0' so root can access the X DISPLAY. >> >> if radeontool or something will allow you to disable the display even >> when you aren't in X, or without proper access to the display (like >> xset requires) you might be able to even escape needing that xhost >> setting. No way of testing it at all myself though. >> >> -- >> Poison [BLX] >> Joshua M. Murphy >> >> > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Laptop Lid Close... 2009-01-26 17:59 ` BRM @ 2009-01-29 15:50 ` BRM 0 siblings, 0 replies; 9+ messages in thread From: BRM @ 2009-01-29 15:50 UTC (permalink / raw To: gentoo-user Just following up - for anyone searching the archives - the bug report mentioned below did solve the problem. When I had added the acpid to the default run-level, I had not restarted hald before starting it, thus the script didn't get called. Any how...it now works excellently. I use radeontool to turn off the screen, and it works without having to know about X. I also send out a message via D-Bus to the KDE Desktop to initiate the screen saver on close, and turn it off on open. (I ignore the password side of the screen saver, but you can honor that too if you like). Thanks for the help all! Ben ----- Original Message ---- From: BRM <bm_witness@yahoo.com> To: gentoo-user@lists.gentoo.org Sent: Monday, January 26, 2009 12:59:55 PM Subject: Re: [gentoo-user] Laptop Lid Close... Cool. Thanks. That looks like it should solve the issue. Ben ----- Original Message ---- From: Gregory SACRE <gregory.sacre@gmail.com> To: gentoo-user@lists.gentoo.org Sent: Monday, January 26, 2009 11:32:32 AM Subject: Re: [gentoo-user] Laptop Lid Close... I've googled a bit and found these two things: [1] http://bugs.gentoo.org/175464 [2] https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/51591 They both refer to problems with hald and acpid entering in conflict. Check if you are using hald. If you are, try stopping it and starting acpid to see if it still gives you the problem. Concerning the fact that the script isn't called, you have to check in your /etc/acpi/event/default. Make sure that you have lines such as: event=.* action=/etc/acpi/default.sh %e Basically, it says that for any event handled by acpi, launch /etc/acpi/default.sh. And in /etc/acpi/default.sh, check for the "lid" event. It should look like this: [...] case "$group" in [...] lid) /etc/acpi/screen_off.sh > /tmp/screen_off 2>&1 [...] where screen_off.sh is the script I sent you in my previous mail. HTH, Greg On Sat, Jan 24, 2009 at 4:58 AM, BRM <bm_witness@yahoo.com> wrote: > For some reason, the script is not getting called when I press the button. > > That is not to say that the system doesn't recognize it - if I set KDE to put the system in stand-by when the lid is closed, it very well will. But as I said earlier, that's not what I want - I just want to turn on/off the monitor. > > I know kacpid is running...but I don't think acpid is...at least, when I tried /etc/init.d/acpid start it complained: > > * Starting acpid ... > acpid: can't open /proc/acpi/event: Device or resource busy > > Ben > > > > ----- Original Message ---- > From: Gregory SACRE <gregory.sacre@gmail.com> > To: gentoo-user@lists.gentoo.org > Sent: Friday, January 23, 2009 2:57:31 PM > Subject: Re: [gentoo-user] Laptop Lid Close... > > This is the script I am using. It is spawned by the default.sh from /etc/acpi: > > -------------------------- SCRIPT START -------------------------- > # default display on current host > export XAUTHORITY="/home/<your_user>/.Xauthority" > DISPLAY=:0.0 > > # find out if monitor is on > STATUS=`cat /proc/acpi/button/lid/LID0/state` > logger "monitor: $STATUS" > > # find out if DPMS is enabled > DPMS=`xset -display $DISPLAY -q | grep -e 'DPMS is'` > logger "dpms: $DPMS" > > # enable DPMS if disabled > if [ "$DPMS" == " DPMS is Disabled" ] > then > logger "Enabling DPMS ..." > xset -display $DISPLAY +dpms > fi > > if [ `echo $STATUS | grep -i closed | wc -l` -eq 1 ] > then > logger "[`date`] Turning display OFF" > xset -display $DISPLAY dpms force off > else > logger "[`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 > unset DPMS > > # comment this line out if you're manually running this script from a > shell (put a # in front of it) > unset DISPLAY > > exit 0 > -------------------------- SCRIPT STOP -------------------------- > > Change the <your_user> variable. > I had also to set xscreensaver to switch off my monitor instead of > blanking it, because I think (not sure) that xscreensaver was > switching on my monitor when it was supposed to start the screensaver > (as after a while, my monitor was switched back on, and as I didn't > see that happening since my xscreensaver modification, I can only > assume that was the problem). > > > HTH, > > Greg > > > On Fri, Jan 23, 2009 at 8:14 AM, Joshua Murphy <poisonbl@gmail.com> wrote: >> On Thu, Jan 22, 2009 at 8:24 PM, BRM <bm_witness@yahoo.com> wrote: >>> I'm running a Dell D600, and I've located a number of tools for it but I am not seeing anything related to when I close the lid. Since I got Gentoo running on it, the Monitor continues running when I close the lid. >>> >>> I've found several sources for doing something as an ACPI event, which seems to be the right method. I can toggle the button with the lid open and cat /etc/acpi/button/lid/LID/state and see it change between 'open' and 'closed'; and I know I could write myself a little script do something like calling radeontool to turn off the backlight, but I'd like to find a more official method. >>> >>> I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes out and all), but I didn't see anything for a 'turn off monitor on lid close' setting (preferrably root controlled so that it affects all users). The only thing I can find is a the standby/suspend/shutdown/logoff, system performance, and CPU throttling. I don't really want to do any of that - just put the monitor into stand-by, not necessarily the whole system. >>> >>> Any how...I'd really like to get this working. >>> >>> TIA, >>> >>> Ben >> >> In... >> /etc/acpi/default.sh >> >> there's a comment (with commented code you can use following it)... >> # if your laptop doesnt turn on/off the display via hardware >> # switch and instead just generates an acpi event, you can force >> # X to turn off the display via dpms. note you will have to run >> # 'xhost +local:0' so root can access the X DISPLAY. >> >> if radeontool or something will allow you to disable the display even >> when you aren't in X, or without proper access to the display (like >> xset requires) you might be able to even escape needing that xhost >> setting. No way of testing it at all myself though. >> >> -- >> Poison [BLX] >> Joshua M. Murphy >> >> > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Laptop Lid Close... 2009-01-23 7:14 ` Joshua Murphy 2009-01-23 14:57 ` Gregory SACRE @ 2009-01-24 16:21 ` Brandon Vargo 1 sibling, 0 replies; 9+ messages in thread From: Brandon Vargo @ 2009-01-24 16:21 UTC (permalink / raw To: gentoo-user On Fri, 2009-01-23 at 02:14 -0500, Joshua Murphy wrote: > if radeontool or something will allow you to disable the display even > when you aren't in X, or without proper access to the display (like > xset requires) you might be able to even escape needing that xhost > setting. No way of testing it at all myself though. I use the dpms feature of sys-apps/vbetool to control the state of the display from a shell script called by acpid. It works even when X is not running and does not need access to the X display if X is running. Also, it works with graphics cards from multiple vendors, as it uses VESA extensions. From personal experience, I know it works with the Intel graphics chipset in my laptop (x86) and also with the Nvidia graphics card in my desktop (amd64). The latter does not have a lid to close, of course, but vbetool can still turn off the display. --Brandon Vargo ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <bXj1Y-7bf-1@gated-at.bofh.it>]
* Re: [gentoo-user] Laptop Lid Close... [not found] <bXj1Y-7bf-1@gated-at.bofh.it> @ 2009-01-25 14:59 ` Gian Calgeer 0 siblings, 0 replies; 9+ messages in thread From: Gian Calgeer @ 2009-01-25 14:59 UTC (permalink / raw To: gentoo-user Hi BRM wrote: > I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 comes > out and all) There's no need to wait for Portage 2.2 in order to install KDE 4, 2.1.6.4 also seems to support EAPI 2. Gian ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-01-29 15:50 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-01-23 1:24 [gentoo-user] Laptop Lid Close BRM 2009-01-23 7:14 ` Joshua Murphy 2009-01-23 14:57 ` Gregory SACRE 2009-01-24 3:58 ` BRM 2009-01-26 16:32 ` Gregory SACRE 2009-01-26 17:59 ` BRM 2009-01-29 15:50 ` BRM 2009-01-24 16:21 ` Brandon Vargo [not found] <bXj1Y-7bf-1@gated-at.bofh.it> 2009-01-25 14:59 ` Gian Calgeer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox