Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Automatically Turning Off your Monitor
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
locke2053
n00b
n00b


Joined: 29 May 2003
Posts: 58
Location: Ohio State University

PostPosted: Sun Nov 30, 2003 4:08 am    Post subject: [HOWTO] Automatically Turning Off your Monitor Reply with quote

ACPI Monitor Mini-HowTo
or Automatically Turning Off Your Monitor with Linux
by Nick Brown (http://nick-brown.us)

I got a new LCD monitor for my Linux system, however I was concerned I would burn out the backlight because Linux would only blank the screen when the computer was not in use, rather than turn off the monitor completely like Windows did. After some searching, I found out how to make Linux do this very easily. Just follow these three steps:

1) Compile your kernel with ACPI enabled.
I use Gentoo Linux, and the default kernel comes with this already enabled. To check if you have ACPI complied and enabled, see if the file "/proc/acpi/info" exists.

2) Install and run acpid.
On Gentoo, you can install this by running the command "emerge acpid". Then, make it run whenever you boot with the command, "rc-update add acpid default". So that you don't have to reboot, you can now start acpid manually with the command "/etc/init.d/acpid start".

3) Configure XFree86 to use DPMS.
Edit /etc/X11/XF86Config. Add the line 'Option "DPMS"' to the 'Monitor' section of the file. Then add the line 'Option "OffTime" "20"' to the 'ServerLayout' section of the file. The number 20 is the number of minutes of inactivity before the monitor is turned off. It will be turned on when you use the mouse or keyboard again. Optionally, you can use "StandbyTime" for minimal power saving, or "SuspendTime" for moderate power saving. I use "SuspendTime" with my LCD, because they all turn off the backlight, but the other two cause my monitor to say "Lost Signal" for a few seconds first.

To test if everything is working without restarting X and waiting 20 minutes, you can use the command "xset dpms force off" from an xterm. "standby" and "suspend" may be used in place of "off" in that command.

For more detailed information, see the Battery Powered Linux Mini-HOWTO available at http://www.tldp.org/HOWTO/Battery-Powered/.

Update: You don't need to install the acpid package if you are using the 2.6 kernel.

Copyright notice: I grant everyone the right to use this information however they wish, as long as they give me credit.


Last edited by locke2053 on Tue Jun 15, 2004 1:18 am; edited 2 times in total
Back to top
View user's profile Send private message
DArtagnan
l33t
l33t


Joined: 30 Apr 2002
Posts: 942
Location: Israel, Jerusalem

PostPosted: Wed Dec 03, 2003 6:25 am    Post subject: Reply with quote

Great,
Thank you!
_________________
All for one and one for All
--

MACPRO machine...
Back to top
View user's profile Send private message
aroben
n00b
n00b


Joined: 10 Oct 2003
Posts: 33

PostPosted: Wed Dec 03, 2003 6:49 pm    Post subject: Re: [HOWTO] Automatically Turning Off your Monitor Reply with quote

locke2053 wrote:

To test if everything is working without restarting X and waiting 20 minutes, you can use the command "xset dpms force off" from an xterm. "standby" and "suspend" may be used in place of "off" in that command.


I believe you do have to restart X, since you've just added the 'Option "DPMS"' line. Otherwise xset won't have any effect.

Great HOWTO Locke. I'd been looking for something like this for a while.

-Adam
Back to top
View user's profile Send private message
EvilSporkMan
n00b
n00b


Joined: 02 Sep 2003
Posts: 7

PostPosted: Wed Dec 03, 2003 10:33 pm    Post subject: Reply with quote

Can you turn the screen off at the command line too?
Back to top
View user's profile Send private message
aroben
n00b
n00b


Joined: 10 Oct 2003
Posts: 33

PostPosted: Wed Dec 03, 2003 10:44 pm    Post subject: Reply with quote

EvilSporkMan wrote:
Can you turn the screen off at the command line too?


DPMS can't turn off the power to your screen like pressing its power button would do. It can power down the screen into a "sleep" mode to save power, but the screen will never be fully off. I don't know if there's any way to fully power down a monitor other than pressing the power button, although that would be useful for a shutdown script.

-Adam
Back to top
View user's profile Send private message
MartinP
n00b
n00b


Joined: 01 Nov 2003
Posts: 14

PostPosted: Wed Dec 03, 2003 11:25 pm    Post subject: Reply with quote

I don't know about your monitor but standard monitors can at least switch to a state which is the same as if you power down you computer and the monitor goes off because of no VGA signal. Try "xset dpms force off".

In that state most monitors typically consume less than 0.5W which is something one doesn't really have to bother about IMHO.
Back to top
View user's profile Send private message
aroben
n00b
n00b


Joined: 10 Oct 2003
Posts: 33

PostPosted: Thu Dec 04, 2003 2:07 am    Post subject: Reply with quote

MartinP wrote:

In that state most monitors typically consume less than 0.5W which is something one doesn't really have to bother about IMHO.


That 0.5W is what I was talking about. The monitor isn't technically "off," but it's practically the same thing.

-Adam
Back to top
View user's profile Send private message
snakattak3
Guru
Guru


Joined: 11 Dec 2002
Posts: 468
Location: Seattle

PostPosted: Thu Dec 04, 2003 2:34 am    Post subject: Reply with quote

Awesome. This is something i've never even realized you could do so easily. Thanks for the post and +1 more for the Documentation, Tips & Tricks section :) A hint for other users, don't use DMPS like I did, and cause yourself unwanted troubles. Thanks again.
_________________
Ban Reality TV!
Adopt an Unanswered Post
Back to top
View user's profile Send private message
Kryptik
n00b
n00b


Joined: 22 Oct 2003
Posts: 54
Location: 33

PostPosted: Thu Dec 04, 2003 12:57 pm    Post subject: Reply with quote

I love you folks...

why is it that always when I have an idea to enhance my gentoo install, the solution is being posted in the forum some days before?

gentoo rocks, but you people rock the fucking hell.


kisses,

Kryptik
Back to top
View user's profile Send private message
ILikePi
n00b
n00b


Joined: 29 Nov 2003
Posts: 22
Location: Rhode Island, USA

PostPosted: Fri Dec 05, 2003 4:01 am    Post subject: Reply with quote

er.....so does this solution require X to be running or will it work from just the console?
_________________
Keyboard not found.
Press F1 to continue.
Back to top
View user's profile Send private message
marshall_j
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2003
Posts: 98
Location: NZ

PostPosted: Fri Dec 05, 2003 7:09 am    Post subject: Reply with quote

Cheers for this.
I'm trying on my R40 and it still won't turn off the backlight tho.
I'm running through a bundle of tricks to find something that will turn it off but the only thing so far that works under linux is actually pressing the lid switch itself.

Ideas? It seems to be bios controlled....
Back to top
View user's profile Send private message
Biker
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 170
Location: A very dark, cold and moisty place...

PostPosted: Sat Dec 06, 2003 6:22 pm    Post subject: Reply with quote

This all works great as root, but I can't get it to work as ordinary user.

I set it all up as described. When I log in as root with X, which I do only very rarely, the screen turns off both manually (using xset) and automatically (by X).

But when I login under X, gdm and Gnome with my ordinary login it wont work. (The normal screensaver pops in, though.)

Makes me think of access rights, but I don't know where to look or what to verify. Any ideas? Does it work for anyone else as 'ordinary' user?

Biker
_________________
The Internet never forgets.
Where 'never' points in the direction of a moment in the very, very far future.
Back to top
View user's profile Send private message
MartinP
n00b
n00b


Joined: 01 Nov 2003
Posts: 14

PostPosted: Sun Dec 07, 2003 12:00 pm    Post subject: Reply with quote

Biker: I guess the XF86Config settings are overriden by gnome. Have a look at the gnome screensaver menu. It's in "Desktop-Settings->Complex->Screensaver" (or something similar, mine is in German so I'm not really sure if my back-translation is right ;)). In that menu there is a tab called "Complex" again in which you can set your power management preferences for gnome.

marshall_j: on my ThinkPad X30 it works without any problems. Maybe you have set your system to first use one of the "higher" power save states? I think the first one only blanks the screen on my X30 but the "off" states switches the backlight off.
Back to top
View user's profile Send private message
brooney
n00b
n00b


Joined: 20 Sep 2002
Posts: 55
Location: The Netherlands

PostPosted: Mon Dec 08, 2003 8:35 pm    Post subject: how can you tell if it's configured Reply with quote

hey, thanks forthe posts on how to do this.

however, i have followed the directions and i'm not sure that it is actually being used. my acpid starts fine but if i do a lsmod, none of the acpi modules are loaded. if i modprobe them and then do a lsmod, they all say they are unused....even after restarting the acpid.

i've also tried to just let it sit and wait to see what happens and i don't seem to get any love there either.

i compiled the acpi drivers as modules and i'm running on an inspiron 8600.

Ben
Back to top
View user's profile Send private message
brettski
n00b
n00b


Joined: 20 Nov 2003
Posts: 2

PostPosted: Mon Dec 08, 2003 8:47 pm    Post subject: Solution also works only for root Reply with quote

For me (as with biker) DPMS only works if I login as root. It also works in GDM. But not as a regular user. I tried changing the Xscreensaver settings as suggested but no luck.

Help!
Back to top
View user's profile Send private message
Biker
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 170
Location: A very dark, cold and moisty place...

PostPosted: Tue Dec 09, 2003 12:44 pm    Post subject: Reply with quote

Furthermore, I've noticed that logged in as an ordinary user under Gnome, it is possible to execute
Code:
xset dpms force off
in xterm.

The monitor does turn off. But it automagically goes on again after about two seconds...

I can repeat this as much as I want (even though I don't want it ;-) as any ordinary user in this system.

Biker
_________________
The Internet never forgets.
Where 'never' points in the direction of a moment in the very, very far future.
Back to top
View user's profile Send private message
Biker
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 170
Location: A very dark, cold and moisty place...

PostPosted: Tue Dec 09, 2003 2:19 pm    Post subject: Re: [HOWTO] Automatically Turning Off your Monitor Reply with quote

locke2053 wrote:
ACPI Monitor Mini-HowTo


BTW, how does one pronounce "ACPI" ?

Biker
_________________
The Internet never forgets.
Where 'never' points in the direction of a moment in the very, very far future.
Back to top
View user's profile Send private message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Thu Dec 11, 2003 7:42 am    Post subject: Reply with quote

Thanks for this tip. I found that when I set things up as you said, the display would automatically turn off when I was in the kdm logon screen, but once I was logged on (to kde in my case), "dpms q" showed that it was disabled.

The solution I found was that you have to go into the "control panel.>power control ->display power control" and set it up there. This overrides the settings from XF86Config.
Back to top
View user's profile Send private message
atdsm
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jun 2003
Posts: 118
Location: Pennsylvania

PostPosted: Wed Dec 17, 2003 3:52 am    Post subject: Re: [HOWTO] Automatically Turning Off your Monitor Reply with quote

locke2053 wrote:

1) Compile your kernel with ACPI enabled.
I use Gentoo Linux, and the default kernel comes with this already enabled. To check if you have ACPI complied and enabled, see if the file "/proc/acpi/info" exists.


Um, I get stuck on this step. I'm using the 2.6 beta kernel, and I compiled in ACPI. But I still get the system telling me:

Code:
steve # cat /proc/acpi/info
cat: /proc/acpi/info: No such file or directory


Here's the appropriate part of my kernel config:

Code:

#
# Power management options (ACPI, APM)
#
CONFIG_PM=y
# CONFIG_SOFTWARE_SUSPEND is not set
# CONFIG_PM_DISK is not set

#
# ACPI (Advanced Configuration and Power Interface) Support
#
CONFIG_ACPI=y
CONFIG_ACPI_BOOT=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_SLEEP_PROC_FS=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_ASUS is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_BUS=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_ACPI_RELAXED_AML is not set

#
# APM (Advanced Power Management) BIOS Support
#
# CONFIG_APM is not set


Any ideas?

Steve
[/code]
_________________
There are 10 kinds of people: those who know binary and those who don't.
Back to top
View user's profile Send private message
angryelephant
n00b
n00b


Joined: 13 Oct 2003
Posts: 23
Location: san diego

PostPosted: Wed Dec 17, 2003 7:25 pm    Post subject: Re: [HOWTO] Automatically Turning Off your Monitor Reply with quote

Biker wrote:
locke2053 wrote:
ACPI Monitor Mini-HowTo


BTW, how does one pronounce "ACPI" ?

Biker

aye-see-pee-eye
Back to top
View user's profile Send private message
GentooBox
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1168
Location: Denmark

PostPosted: Fri Dec 19, 2003 8:37 pm    Post subject: Reply with quote

xset have no affect on my box.

no matter what i do, it wont do what i tell it to do.
_________________
Encrypt, lock up everything and duct tape the rest
Back to top
View user's profile Send private message
darkweaseljedi
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2003
Posts: 101
Location: Minneapolis, MN

PostPosted: Sat Dec 20, 2003 8:46 pm    Post subject: Reply with quote

gentoobox, same here. I'm going to go mess in the bios and see if that has any impact.
Back to top
View user's profile Send private message
darkweaseljedi
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2003
Posts: 101
Location: Minneapolis, MN

PostPosted: Sun Dec 21, 2003 2:22 am    Post subject: Reply with quote

Nope, bios didn't have any impact. (dpms was already enabled).
Back to top
View user's profile Send private message
darkweaseljedi
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2003
Posts: 101
Location: Minneapolis, MN

PostPosted: Sun Dec 21, 2003 2:56 am    Post subject: Reply with quote

ha! after reading some more:

I needed to put Option "DPMS" in the device section of XF86Config as well as the monitor secion.

In case anyone else finds this post, i have a geforce4 4200 dual head, driving 2 sony monitors, so it works in this config.
Back to top
View user's profile Send private message
hulk2nd
Guru
Guru


Joined: 25 Mar 2003
Posts: 512
Location: Freiburg, Germany

PostPosted: Mon Dec 29, 2003 6:59 am    Post subject: Reply with quote

i have another question. you can do things like this:
Code:
xset -d <display> dpms <standby in s> <suspend in s> <off in s>

so for example
Code:
xset -d 0:0 dpms 600 0 0
to standby the display after 10 minutes. the off option does not work in my case, it resumes immediatly after it blanked. the standby option does the same for me as the off option is supposed to be - it blanks the screen.
but i have problems with the display syntax: 0:0 does not work for me. for some it works, for some not, dunno why. i tried :0.0 instead, but this works only sometimes, only god knows why. the man page could not help me so maybe you have a solution for this.
i'm asking cause i want to use this for acpi events. i dont whant the display to blank if the ac adaptor is connected, but i want it to blank if it is disconnected.

greets,
hulk
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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