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?
You can do it via an Applescript and run it as such:
You can save these as .script files and then run them from the CLI like this:
You can also do it this way, but that requires more setup.
You can install this command line tool from github.com/jmstacey/screenbrightness. The install is pretty easy if you have homebrew:
And usage is straightforward:
Unfortunately it doesn't work for external monitors. See Does Apple support DDC/CI for 3rd party displays via Apple's Thunderbolt to DVI adapter for background on why.
You can change the volume in terminal with the command
Where 7 will set the volume to full.