You are not logged in.

#1 2010-12-28 22:21:48

phlaaj
Member
Registered: 2010-12-24
Posts: 13

[SOLVED] Laptop monitor on/off on lid open/close

Hi all,

Just installed Arch on my laptop, trying to configure the various laptoppy things. I have acpi, acpid and pm-utils installed, and have my laptop set to sleep/suspend when the power button is pressed using /etc/acpi/handler.sh, which is nice.

However, is there also a simple way to turn off the laptop's screen (not suspend, just turn off the monitor) using acpid and handler.sh when the laptop lid is closed, and then have it turn on again when the screen is opened?

Cheers,

Last edited by phlaaj (2010-12-28 23:58:12)

Offline

#2 2010-12-28 22:28:08

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,538

Re: [SOLVED] Laptop monitor on/off on lid open/close

I believe you can configure this and much more using
https://wiki.archlinux.org/index.php/Laptop_Mode_Tools

Offline

#3 2010-12-28 23:09:14

phlaaj
Member
Registered: 2010-12-24
Posts: 13

Re: [SOLVED] Laptop monitor on/off on lid open/close

Thanks skunktrader, just installed laptop-mode-tools to check it out, but it does not automatically turn off the screen on lid close, and I don't see anything in the configuration files about how to do so (it seems more designed to dim the screen when on battery power, for example). I'm thinking there has to be a simple command I can put into my acpid handler script to turn off/on the screen, I just don't know what it is :s

Offline

#4 2010-12-28 23:23:29

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: [SOLVED] Laptop monitor on/off on lid open/close

I find it weird that you ask that because I thought that turning off the lcd screen is handled by the hardware.

Offline

#5 2010-12-28 23:57:52

phlaaj
Member
Registered: 2010-12-24
Posts: 13

Re: [SOLVED] Laptop monitor on/off on lid open/close

Unfortunately this is not automatically handled by my hardware. I think I figured this out however - just copied the following code from the acpid wiki article to the appropriate section in the handler.sh file:

    button/lid)
        #echo "LID switched!">/dev/tty5
    if grep -q open /proc/acpi/button/lid/LID/state
    then
    XAUTHORITY=/home/tim/.Xauthority /usr/bin/xset -display :0.0 dpms force on
    else
    XAUTHORITY=/home/tim/.Xauthority /usr/bin/xset -display :0.0 dpms force off
    fi
        ;;

What had me confused was that the wiki article specified putting the code into lm_lid.sh, whereas it works for me in the standard handler.sh. I am not sure whether laptop-mode-tools was required for this to work. Thanks for the help, sorry if I wasted anyone's time

Offline

#6 2010-12-29 00:01:44

Daniel_F
Member
From: Brazil
Registered: 2010-12-28
Posts: 69

Re: [SOLVED] Laptop monitor on/off on lid open/close

Hi phlaaj,

try this in your handler.sh:

    button/lid)
        #echo "LID switched!">/dev/tty5
        if grep -q open /proc/acpi/button/lid/LID/state
        then
          vbetool dpms on
        else
          vbetool dpms off
        fi
        ;;

hope it helps...

Daniel


EDIT: Here it works without laptop-mode-tools

Last edited by Daniel_F (2010-12-29 00:04:53)

Offline

Board footer

Powered by FluxBB