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


Click here to return to the 'Adjust brightness from Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Adjust brightness from Terminal
Authored by: efreed on Dec 09, '10 09:57:03AM
This is the only way I could find to program brightness up/down into my Microsoft Ergonomic 4000 keyboard. I was able to write an application to do brightness up (and a separate app for brightness down)

Here's how to make the mac brightness-up app:

Save the brightness file to Macintosh HD/Library
Open AppleScript and enter this code
do shell script "/Library/brightness -l"
set lev to result's last word
set lev to lev + 0.05
do shell script "/Library/brightness " & lev

Go to File > Save As... (remember to select "Application" from the File format selection)

Then I set a programmable key on my keyboard to run this application I just saved.
Repeat process with a "- 0.05" in the script to make a brightness down app.

[ Reply to This | # ]

Adjust brightness from Terminal
Authored by: lvs1974 on Jun 04, '12 03:55:46AM

Hey to all!

Could you possibly help me with a script?

I have a problem in string "set lev to lev + 0.05":
AppleScript interpretator can't convert lev to number.



[ Reply to This | # ]
Adjust brightness from Terminal
Authored by: efreed on Jun 04, '12 08:35:19AM

You'll need to download the "brightness" file (link given in this original hint) and have the file path in the first and last line point to it.

Come to think of it, I actually downloaded the brightness file to my user's Library folder (It's a bit easier to get to using Finder)

So here's my BrightnessDown.scpt for example:

do shell script "/Users/Myname/Library/brightness -l"
set lev to result's last word
set lev to lev - 0.05
do shell script "/Users/Myname/Library/brightness " & lev

As a troubleshooting step, open terminal and enter in the commands as a test.

When I enter this in terminal:
/Users/Myname/Library/brightness -l
I get this: (which tells me I have the script downloaded and the command right)
display 0: main display, ID 0x42735c0
display 0: brightness 0.468750



[ Reply to This | # ]