# Making the monitor go to sleep?



## cerbero (Aug 7, 2002)

I was wondering if it's possible to make the monitor go to sleep with a Terminal command.. I have my computer in the same room I'm sleeping, and I have it on all the time, so I don't want the monitor on when I'm sleeping (I have an eMac). Right now I have to go to System Prefs' Energy Saver pane everytime I go to bed. And even then I have to wait 5 minutes for the monitor to sleep, so it would be great if I could do this with just a click whenever I need it..
It doesn't have to be a Terminal command, just some, easy way to do it will be nice 

Thanks.


----------



## symphonix (Aug 7, 2002)

If you can find the AppleScript command that triggers a Sleep (I have a feeling it might be in finder or something) then I guess you could whip up an AppleScript and just launch it from a shell-script using the 'open' command. Alternately, find the config file that holds your sleep setting, and set up a script to alter/change it.

I guess not many people put their computer to sleep through a remote terminal. You do know that, at the computer itself, you only have to choose sleep from the apple menu, or press Power -> S. But then, you wouldn't be asking unless you wanted a way to do it remotely.


----------



## cerbero (Aug 7, 2002)

> _Originally posted by symphonix _
> *If you can find the AppleScript command that triggers a Sleep (I have a feeling it might be in finder or something) then I guess you could whip up an AppleScript and just launch it from a shell-script using the 'open' command. Alternately, find the config file that holds your sleep setting, and set up a script to alter/change it.
> 
> I guess not many people put their computer to sleep through a remote terminal. You do know that, at the computer itself, you only have to choose sleep from the apple menu, or press Power -> S. But then, you wouldn't be asking unless you wanted a way to do it remotely. *


I'm looking for a way to put only the monitor to sleep, not the entire computer. Main thing is I don't want to have to wait 5 minutes before it does, and not have to change the energy settings every night.


----------



## symphonix (Aug 7, 2002)

I'd suggest opening up the plist for energy saver (you'll find it in /Library/Preferences/com.apple.PowerManagement.plist), and finding the entry for the monitor sleep. It is possible to literally edit "MinutesUntilDisplaySleeps" down to 1 minute, even though you can't do this through the pref pane. (you can't go lower as the field is an integer)

You'd create a "standard" copy of this file somewhere safe, and then a "modified" copy as well.

Then, you'd come up with a script that copies a standard energy plist into place, and another that copies your modified one into place. I'm thinking basic shell scripts, here.

You'd run one script to put your display to 1-minute-sleep, and another to put it back to normal. You might need to call something to get it to refresh its prefs, such as the prefs pane.


----------



## xaqintosh (Aug 7, 2002)

you can set this: http://www.versiontracker.com/moreinfo.fcgi?id=14051&db=mac

as your screen saver (it makes the screen go blank) and then if you want the monitor to go to sleep, just set that and it will sleep in 5 minutes. in the screen saver pref pane you can set it so that if you put the cursor in a certain corner the screen saver wil auto-start


----------

