Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is it possible to dim the screen from Terminal, in a Mac with OS X Lion? Is there any command to do control brightness and volume?

share|improve this question

2 Answers

up vote 7 down vote accepted

You can do it via an Applescript and run it as such:

Dimmer:

tell application "System Events"
        key code 107
    end tell

Brighter:

tell application "System Events"
        key code 113
    end tell

You can save these as .script files and then run them from the CLI like this:

osascript ~/Path/to/File

You can also do it this way, but that requires more setup.

share|improve this answer

You can change the volume in terminal with the command

osascript -e 'set volume 7'

Where 7 will set the volume to full.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.