|
|
#1 |
|
Prospect
Join Date: Jul 2005
Posts: 6
|
Simple Script to Turn Off iMac Display
Well, I'm pretty sure that there isn't a way to turn off my iMac display unless I turn off my computer.
However, I am just learning to script and was wondering if someone could make a simple script that: (1) Sets my display to minimum brightness (2) Set display to sleep as soon as possible This is only work around I can think of. Any help would be greatly appreciated. Thanks guys PS: I have a iMac G5 running Tiger |
|
|
|
|
|
#2 |
|
Moderator
Join Date: May 2003
Posts: 4,272
|
You could use the 'pmset' command.
Have you considered using the screen saver function? You could create an image that is all-black and put it in its own folder somewhere. Then, in the screen saver prefs, use the "Choose folder" option to select that folder. Presto, an all-black screen saver. Set one of the Hot Corners and you can turn it on immediately. It can even require a password to get out of if you want. |
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jul 2005
Posts: 6
|
WOW!!! Never thought of that!. Thanks the screen saver trick seems like a nice work around.
I don't know what pmset is. Any articles i can read about it? Last edited by Dredog; 08-02-2005 at 01:54 AM. |
|
|
|
|
|
#4 |
|
Triple-A Player
Join Date: Oct 2004
Posts: 68
|
isn't a black image the worst color for an LCD display? either way you still are at the same brightness and the backlight is on, right?
You can kind of do it in applescript. This is the best I could figure out with a quick search but is by no means an easy answer, it has to start the system prefs then quit it. Code:
tell application "System Preferences"
set current pane to pane "com.apple.preference.displays"
tell application "System Events"
set value of slider 1 of group 2 of tab group 1 of window 1 of process "System Preferences" to 0
display dialog "Click ok" buttons {"OK"} default button 1
set value of slider 1 of group 2 of tab group 1 of window 1 of process "System Preferences" to 1
end tell
quit
end tell
|
|
|
|
|
|
#5 |
|
Moderator
Join Date: May 2003
Posts: 4,272
|
'pmset' is a shell command. You didn't say what kind of scripting you were learning, so I guess I assumed you were doing stuff with the Terminal. If you open the Terminal and type pmset you'll get a very brief summary of what it does. Typing 'man pmset' gets you more details. It's a command to control the settings that you would normally change in the Energy Saver preferences.
Djhayn, I'm not sure what you mean by "worst" color for an LCD. And yes, the backlight is still on, but the fact that the display is black means that the light isn't coming through. It would still be smart to have the display turn off after a few minutes, but you might as well just use the screen saver first. |
|
|
|
|
|
#6 |
|
Triple-A Player
Join Date: Oct 2004
Posts: 68
|
just did some digging around on this site here I found this:
http://www.macosxhints.com/article.p...40120215017652 which links to: http://wincent.org/article/articleview/36/1/8/ Wincent has a good tutorial for adding the shell script to the apple menu. He also explains what I meant by worst: "Unlike normal monitors, LCDs are working their hardest when they are displaying a black screen. This is because the LCDs (the diodes, that is) have to block all the light coming from the backlight in order to darken each pixel." |
|
|
|
|
|
#7 | |||||||||||||||||||||||
|
Triple-A Player
Join Date: Oct 2004
Posts: 68
|
My fault, it was posted in the UNIX help, that would be the only downside of reading this forum through RSS, don't notice the categories. |
|||||||||||||||||||||||
|
|
|
|
|
#8 | |||||||||||||||||||||||
|
Moderator
Join Date: May 2003
Posts: 4,272
|
Well, yeah. Anyone who knows how an LCD works knows that that's technically true, though we should quibble with the word "hardest". It would be most correct to say that an LCD is using the most amount of electricity under those conditions. But that doesn't mean you're shortening the life of the display. Any display engineers on this forum want to say one way or the other? My guess is that of the total amount of power used, the backlight takes up the vast majority of it. That's why "passive" LCDs without a backlight, like on a digital watch, can go for years on tiny batteries.It's a fairly academic question anyway. I doubt most people would turn off the Energy Saver settings entirely. |
|||||||||||||||||||||||
|
|
|
|
|
#9 |
|
Registered User
Join Date: Apr 2008
Posts: 1
|
You can use Shades. Its free (just google Shades OS X). It lets you controll screen brightness. Be sure to look at the preferences carefully. You can even set key combos to make the screen dimmer and lighter. For 10.3 and up.
|
|
|
|
|
|
#10 |
|
Registered User
Join Date: Apr 2008
Posts: 1
|
Easy way to sleep monitor
Control+Shift+Eject
Works on my iMac with Leopard. |
|
|
|
|
|
#11 |
|
Hall of Famer
Join Date: Aug 2005
Location: USA
Posts: 3,418
|
In Terminal:
Code:
pmset force -a displaysleep 107374183
__________________
15" MacBook Pro (Mid 2010), 2.4 GHz Core i5, 10.6.5, 4GB RAM PowerMac G4 "Quicksilver", 733 MHz, 10.4.11, 1.5GB RAM iPod Touch 5G, 32GB, iOS 6.1.3 |
|
|
|
|
|
#12 | |||||||||||||||||||||||
|
Prospect
Join Date: Jul 2007
Posts: 18
|
Wow, good trick! But be careful when using this command because if you run it just like that you will lost access to your monitor (the display will stay dark, keyboard and mouse reactivate it only to shut down again before it fully reactivate). I create this little script to use this "feature" nicely: Code:
#!/bin/sh
# SPAS 2008L7 by S P Arif Sahari Wibowo http://www.arifsaha.com/
DispSleepOri=$(pmset -g | grep displaysleep | awk '{ print $2; }')
pmset force -a displaysleep 107374183
sleep 2
pmset force displaysleep ${DispSleepOri:=30}
Last edited by arifsaha; 12-09-2008 at 09:04 AM. Reason: fix quoted message |
|||||||||||||||||||||||
|
|
|
![]() |
|
|