View previous topic :: View next topic |
Author |
Message |
philosopher_sam n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 17 Mar 2004 Posts: 26 Location: southern California
|
Posted: Thu Mar 25, 2004 3:36 pm Post subject: Automatically turn off my laptop screen |
|
|
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 .
Regards,
Sam |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nein Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 14 Nov 2003 Posts: 346 Location: Spain
|
Posted: Thu Mar 25, 2004 3:45 pm Post subject: |
|
|
/usr/X11R6/bin/xset -display :0 dpms force off |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nein Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 14 Nov 2003 Posts: 346 Location: Spain
|
Posted: Thu Mar 25, 2004 3:46 pm Post subject: |
|
|
I forgot to say the before mentioned command is run by acpid when I close the lid |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
philosopher_sam n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 17 Mar 2004 Posts: 26 Location: southern California
|
Posted: Thu Mar 25, 2004 3:54 pm Post subject: Thanks... |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
mayday147 l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/32379238641fab62bc0853.jpg)
Joined: 22 Mar 2004 Posts: 825 Location: Bucharest, Romania
|
Posted: Thu Mar 25, 2004 4:22 pm Post subject: |
|
|
maybe you just have to compile the kernel with ACPI support _________________ gentoo.ro |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nein Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 14 Nov 2003 Posts: 346 Location: Spain
|
Posted: Fri Mar 26, 2004 8:30 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
philosopher_sam n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 17 Mar 2004 Posts: 26 Location: southern California
|
Posted: Fri Mar 26, 2004 5:53 pm Post subject: Any suggestions on getting me started... |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Earthwings Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/49753421747790001d409d.png)
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
albright Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/524660825462570600c7fb.jpg)
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Fri Mar 26, 2004 6:05 pm Post subject: sample default.sh |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|