Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Automatically turn off my laptop screen
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
philosopher_sam
n00b
n00b


Joined: 17 Mar 2004
Posts: 26
Location: southern California

PostPosted: Thu Mar 25, 2004 3:36 pm    Post subject: Automatically turn off my laptop screen Reply with quote

To fellow Gentoo users:

Is there anything I can emerge that would simply force my laptop screen to shut off (to save power) instead of only blanking? There is a different between a blank screen and a screen that is off :D.

Regards,

Sam
Back to top
View user's profile Send private message
nein
Guru
Guru


Joined: 14 Nov 2003
Posts: 346
Location: Spain

PostPosted: Thu Mar 25, 2004 3:45 pm    Post subject: Reply with quote

/usr/X11R6/bin/xset -display :0 dpms force off
Back to top
View user's profile Send private message
nein
Guru
Guru


Joined: 14 Nov 2003
Posts: 346
Location: Spain

PostPosted: Thu Mar 25, 2004 3:46 pm    Post subject: Reply with quote

I forgot to say the before mentioned command is run by acpid when I close the lid
Back to top
View user's profile Send private message
philosopher_sam
n00b
n00b


Joined: 17 Mar 2004
Posts: 26
Location: southern California

PostPosted: Thu Mar 25, 2004 3:54 pm    Post subject: Thanks... Reply with quote

The command above does work. Forgive the very newbie question, how would I configure the system to give that command when I close the lid?

Thanks,

Sam
Back to top
View user's profile Send private message
mayday147
l33t
l33t


Joined: 22 Mar 2004
Posts: 825
Location: Bucharest, Romania

PostPosted: Thu Mar 25, 2004 4:22 pm    Post subject: Reply with quote

maybe you just have to compile the kernel with ACPI support
_________________
gentoo.ro
Back to top
View user's profile Send private message
nein
Guru
Guru


Joined: 14 Nov 2003
Posts: 346
Location: Spain

PostPosted: Fri Mar 26, 2004 8:30 am    Post subject: Reply with quote

If you have acpi compiled in your kernel you just need acpid (emerge -p acpid). You can create scripts than will be run when a acpi event happens: closed lid, suspend, etc.
Back to top
View user's profile Send private message
philosopher_sam
n00b
n00b


Joined: 17 Mar 2004
Posts: 26
Location: southern California

PostPosted: Fri Mar 26, 2004 5:53 pm    Post subject: Any suggestions on getting me started... Reply with quote

Thanks to all of you for help.

I emerged the acpid package. Any suggestion on how I would get started making such scripts?

Thanks again,

Sam

P.S. I will start looking for documentation.
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Fri Mar 26, 2004 5:56 pm    Post subject: Reply with quote

http://www.stud.uni-karlsruhe.de/~uxhz/gentoo/power-management
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Fri Mar 26, 2004 6:05 pm    Post subject: sample default.sh Reply with quote

below is a sample /etc/acpi/default.sh script; the "lid" action
is to put the computer to sleep (and fix a little clock problem
when it wakes up :) ); you can replace it with the dpms force
off command, or add that command or whatever. On my acer
there is a little switch that forces the screen off when the lid
is closed so I don't need to tell the computer that ...
(formatting is bit messed up here ... esp. indentation)

#!/bin/sh
# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}
action=${1/*\//}

case "$group" in
button)
case "$action" in
power) /sbin/init 0
;;

lid) if cat /proc/acpi/button/lid/LID/state | grep -q closed; then
/bin/echo 1 > /proc/acpi/sleep && hwclock --hctosys
fi
;;

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

battery) if cat /proc/acpi/ac_adapter/AC/state | grep -q off; then
/bin/echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
else /bin/echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
fi
;;
*)
logger "ACPI group $group / action $action is not defined"
;;
esac
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