Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'No admin version...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
No admin version...
Authored by: jriskin on Jul 29, '06 01:00:48AM
This is about POWERSAVE on displays NOT screensavers NOR system sleep. I do a very similar script but without needing all that administrator stuff. I suppose you could combine the two methods and get both the fixed toggle and no-admin password.

So instead of
do shell script ("pmset dim " & thetime) password 
Make it...

do shell script ("pmset force dim " & thetime)
Force doesn't effect the preferences, just the settings in memory, so it doesn't require privlidges.

Too bad it still takes a full minute to take effect. I have 2 20" dell monitors and they use about 40 watts each and seem to put off most of that in heat. So it would be very helpful to have a single keypress to go in to powersave mode.

[ Reply to This | # ]
Ok, this will work better...
Authored by: jriskin on Jul 29, '06 02:25:08AM
Only one problem...since I don't set the variable, it'll never toggle...so I just spent a few minutes learning some applescript...so if this is all bad form, forgive me. I also didn't want to muck around with other apps like butler or geektool, so i just had it read the current setting aloud.

set thePath to (path to home folder) & ".monitorsleep" as string

try
	set thetime to (read file thePath as integer)
on error
	set fRef to (open for access file thePath with write permission)
	set thetime to 10
	write thetime as integer to fRef
	close access fRef
end try

set thetime to (read file thePath as integer)

if thetime is 1 then
	set thetime to 10
	say "Ten"
else
	set thetime to 1
	say "One"
end if
set fRef to (open for access file thePath with write permission)
write thetime as integer to fRef
close access fRef

do shell script ("pmset force dim " & thetime)
Hope it works out. If someone figures out how to set it to 1 second THAT would rock =)

[ Reply to This | # ]
Ok, this will work better...
Authored by: ob1cannoli on Jul 29, '06 08:29:11AM

thanks for that! I personally don't mind the password but I figure there are users that would.
and yes, the end-all-be-all of solutions would be an on/off key without any waits at all, but for now this is the best i've found.



[ Reply to This | # ]