# Laptop Monitor

## vf1sveritech

I have a Vaio PCG-FRV37 and it doesnt have a manual switch for the monitor.  

So when i close the lid the monitor doesnt shutoff, however in windows it does shut off when i close it. So there has to be a switch that works with some driver.  Does anybody know of something I can use to to turn the monitor off when i close the screen??

----------

## oumpah-pah

If you use acpi, the lid is considered as a button, listed under /proc/acpi/button/lid/LID. So you can define whatever action you want when closing or opening the lid. I read that with radeon graphic cards, you could

```
emerge radeontool
```

and use it to turn off the backlight.

----------

## vf1sveritech

alright cool, I'll try it out.

Thanks

----------

## vf1sveritech

ok i emerged radeontool  and now i can type

```
radeontool light off
```

to turn off the light and replace off with on to turn it on.  

In the acpi directory there was a state file that just read 'state:  open' and the file 'info' that read 'type:  lid switch'

do I edit the state file? or make new file, so that when i close the lid the backlight turns off?

----------

## oumpah-pah

The state file is change by acpi to reflect your lid's state. You must not edit it. You can tell acpi what it should do when you open or close the lid by placing a script in /etc/acpi/ (look at the default script as an example).

----------

## vf1sveritech

I dont see any default script in proc/acpi. There are a few text files but they just say random stuff.

----------

## oumpah-pah

The script isn't in /proc/acpi, but in /etc/acpi. And I forgot to tell you that you must

```
emerge acpid
```

first, and

```
rc-update add acpid boot
```

if you didn't do that already.

----------

## vf1sveritech

..../etc/acpi.....omgogmogmogmgoommogmoomgomomgomgmogmogmgm

....sorry. wow. I am an idiot. I thought it was in /proc and root doesnt even have write privilages in there so i couldnt write a new one...I mean.. I KNEW THAT!

I did emerge acpid, so its sorta all good.  Thanks for the clearification.

----------

## vf1sveritech

how do i restart acpid ?

----------

## oumpah-pah

```
/etc/init.d/acpid restart
```

----------

## vf1sveritech

heh, thanks, i just found it tho

----------

## vf1sveritech

AHHH it doesnt work.   I have tried several different lines in the default.sh but some how its not getting through.

```
sudo radeontools light off
```

turns off the monitor completely.

sshing from my desktop when the lid is closed and typing

```
tail /proc/acpi/button/lid/LID/state
```

turns the backlight off, and when it is open it turns it on.

I have tried both of these in the default.sh, but somehow it doesnt seem to read it. or something.  

I have acpid running.  is there something that i am missing or what?

----------

## oumpah-pah

Could you post your default.sh script?

----------

## vf1sveritech

Sure

```

set $*

group=${1/\/*/}

action=${1/*\//}

case "$group" in

        button)

                case "$action" in

#               lid)    lidstate="`cat /proc/acpi/button/lid/LID/state | awk '{print $2}'`"

#                       case "$lidstate" in

#                       open)   radeontool light on

#                               logger "LCD panel is $lidstate"

#                               ;;

#                       closed) radeontool light off

#                                logger "LCD panel is $lidstate"

#                               ;;

                lid)    tail /proc/acpi/button/lid/LID/state

                        ;;

                power)  /etc/init.d/xdm stop

                        /sbin/halt

                        ;;

                                ;;

                        *)      logger "ACPI action $action is not defined"

                                ;;

                esac

                ;;

        *)

                logger "ACPI group $group / action $action is not defined"

                ;;

esac

```

The huge area that is commented out was what some other guy did,  I just replaced the commands he used with the radeontool one but that didnt work so i commented it out and tried the other one.  I must be making just some tiny mistake, but i have no idea

----------

## wpoely86

Try this:

```

set $*

group=${1/\/*/}

action=${1/*\//}

case "$group" in

        button)

                case "$action" in

               lid)    lidstate="$(cat /proc/acpi/button/lid/LID/state | awk '{print $2}')"

                       case "$lidstate" in

                       open)   radeontool light on

                               logger "LCD panel is $lidstate"

                               ;;

                       closed) radeontool light off

                                logger "LCD panel is $lidstate"

                               ;;

                       esac

                        ;;

                power)  /etc/init.d/xdm stop

                        /sbin/halt

                        ;;

                        *)      logger "ACPI action $action is not defined"

                                ;;

                esac

                ;;

        *)

                logger "ACPI group $group / action $action is not defined"

                ;;

esac

```

----------

## vf1sveritech

omg!  i finally checked the log to see if the lid was actually triggering the event.  and it was, but it didnt like some ;;'s on line 27.  And checking back on what you pasted ishould have, i noticedd that you did remove them.  I thought that only the stuff for lid was corrected..so it works now.  Thank you so much.

----------

## Thorir

Hi,

first of all thank you for your tips.

Everything works fine, but after opening the lid of my Fujitsu-Siemens Amilo D, cat /proc/acpi/button/lid/LID/state gives closed and so the lid stays off.

What can I do? Howto swich it on without typing radeontool light on blind?

Thank you,

Thorir

----------

## nik1982

For me it also works out to just include the option "DBMS" in my xorg config-file and than turn off the light with xset dpms force off. Also i can tell xscreensaver with DBMS enabled to turn off the light after some time.

Dominik

----------

