# Screen brightness through terminal



## caseyhayward (Apr 23, 2007)

Hello,

I am a terminal novice, but the screen brightness buttons won't work on my ibook G4.  Can I use a terminal command to acheive the same control and if so, what is/are that (those) command(s)?


----------



## fryke (Apr 23, 2007)

What about using the Displays preference pane? And why don't the keys work?


----------



## caseyhayward (Apr 23, 2007)

thanks fryke,

I was hoping for something quicker/cooler than using the pref pane but you are probably right that is my best option.  The keys don't work because my wife spilled water on the keyboard yikes!


----------



## fryke (Apr 23, 2007)

You probably could whip up something with AppleScript. Maybe some scripts exist already... Wouldn't know, though. Google might.


----------



## macbri (Apr 23, 2007)

It ain't pretty, and it ain't ideal (you'd need to play around with the delay settings etc. to work depending on the speed of your machine), but you could alias "brighter" to something like:


```
osascript -e 'tell application "System Events" to repeat 50 times' -e 'key code 113' -e 'delay 0.1' -e 'end repeat'
```
 and "darker" to:


```
osascript -e 'tell application "System Events" to repeat 50 times' -e 'key code 107' -e 'delay 0.1' -e 'end repeat'
```


----------

