From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LQNTS-0007yf-Lm for garchives@archives.gentoo.org; Fri, 23 Jan 2009 14:57:34 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B5642E084D; Fri, 23 Jan 2009 14:57:32 +0000 (UTC) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by pigeon.gentoo.org (Postfix) with ESMTP id 554C6E084D for ; Fri, 23 Jan 2009 14:57:32 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id e21so2616879fga.14 for ; Fri, 23 Jan 2009 06:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+Hy7R4I2cgXhYa6yTyUZ2KSeEVjbOBd2PAQU+/2/UXU=; b=GuhgQEDoPnXGKHbSHy3K++3e5pbGRlqYn2tKYHrr6p/tPZ7qZ44WNIXVSuXm4HIPGd /AZI2beQUPfN2RdUfYn446x6rNVc/9lv3tnUQMNGgyBn9xoqjPX9ik9/3xZFXMQMPo9+ ExPm4WIxxRN663MY2z4+e9VL6HXTTv02oKrUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mU7FCB+4NC8DNir/oJ6/4AXAgbW0rbZAD7/SRvaSG+eEdJxBR/x5kLR+5z3hLWn7rA mlebjCYlEJBL8MKVpA6WZC22ZDiCrfVhLXM6HS5AGa86I/T32NsjVOdkLnbFU8Z2ajtW JcrHfRW9o/x8qVh39+/wgKWbU4ovCi50vEqNI= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.223.114.135 with SMTP id e7mr949114faq.89.1232722651699; Fri, 23 Jan 2009 06:57:31 -0800 (PST) In-Reply-To: References: <668013.59864.qm@web65415.mail.ac4.yahoo.com> Date: Fri, 23 Jan 2009 15:57:31 +0100 Message-ID: <5e213dd40901230657s28dec766n108f2352bd2e9e6b@mail.gmail.com> Subject: Re: [gentoo-user] Laptop Lid Close... From: Gregory SACRE To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 7d1458ce-2b18-4305-b30d-3f6de5ea672e X-Archives-Hash: b608e56f04fac6259a9679d0923ca95b This is the script I am using. It is spawned by the default.sh from /etc/ac= pi: -------------------------- SCRIPT START -------------------------- # default display on current host export XAUTHORITY=3D"/home//.Xauthority" DISPLAY=3D:0.0 # find out if monitor is on STATUS=3D`cat /proc/acpi/button/lid/LID0/state` logger "monitor: $STATUS" # find out if DPMS is enabled DPMS=3D`xset -display $DISPLAY -q | grep -e 'DPMS is'` logger "dpms: $DPMS" # enable DPMS if disabled if [ "$DPMS" =3D=3D " 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 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 wrote: > On Thu, Jan 22, 2009 at 8:24 PM, BRM 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 s= eems 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 'cl= osed'; and I know I could write myself a little script do something like ca= lling radeontool to turn off the backlight, but I'd like to find a more off= icial method. >> >> I mostly run KDE 3.5 (I'll go to KDE4 when I can...once portage 2.2 come= s out and all), but I didn't see anything for a 'turn off monitor on lid cl= ose' setting (preferrably root controlled so that it affects all users). Th= e only thing I can find is a the standby/suspend/shutdown/logoff, system pe= rformance, 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 > >