Automatically adjust display brightness via Terminal / Pretty good solution

This hint is for all of you who experience any problem with the adjustment of the display brightness.
*Short version*
After a cold and/or warm start, it sometimes happens that the brightness was changed by the system itself to its dim power saver setting or maximum value and sometimes - what a big surprise - remains as it has been configured.
I had spotted plenty of articles about this phenomenon, but none of them yielded a solution. I then decided to solve this problem by going the pragmatically way and use some kind of software which dims the display to my preferred setting. And the winner is: brightness.
This tiny program works perfect and you will love its benefit by using it in terminal - yes, brightness is a command line utility. On top of this, brightness is able to control different displays, internal and external. The clou: beside using the precompiled binary you can also download the source code here, modify it to make the program fit your needs and then compile it using Xcode.
1. Installation
Download a precompiled version of the command line utility brightness here and extract the binary to your desired path (e.g. /usr/bin).
2. Usage
"brightness -l -v" dumps the current display attributes (-v for verbose mode) while "brightness 0.5" modifies the brightness of the main display to half of its max value and "brightness -m 1 1" let a second display become shiny. Just play little bit around.
3. Automatically launch
Simply create a .plist file and drop it, for example, in ~/Library/LaunchAgents. Or make use of an AppleScript or a Terminal Script to let it launch.
That's it. Comments are welcome.
*Long version*
It seems to be, that the adjustment of the display brightness of an iMac and MacBook/Pro (maybe also other models are affected) drives a life of its own. After a cold and/or warm start, it sometimes happens that the brightness was changed by the system itself to its dim power saver setting or maximum value and sometimes - what a big surprise - remains as it has been configured.
I had spotted plenty of articles about this phenomenon, but only found terms like "Did you already disabled the ambient light sensor", "Did you already reset the PRAM?", "Did you already reset the NVRAM?", "Did you already…BLAH". Far from it, all of these tips have one thing in common: none of them yielded a solution. As a last resort, I thought, it was a good idea to install 10.6 from the scratch just to find out that the above mentioned phenomenon occurs right after a few days of using OS X.
I then decided to solve this problem by going the pragmatically way and use some kind of software which dims the display to my preferred setting. There are a few applications to do this, but always it was necessary to drag a slider or type in a value to dim the display, so none of them allowed an automatic configuration. No, I am not a very sophisticated person, I only prefer to use software which is simply well-thought-out. And the winner is: brightness.
This tiny program works perfect and you will love its benefit by using it in terminal - yes, brightness is a command line utility. On top of this, brightness is able to control different displays, internal and external. The clou: beside using the precompiled binary you can also download the source code here, modify it to make the program fit your needs and then compile it using Xcode.
1. Installation
Download a precompiled version of the command line utility brightness here and extract the binary to your desired path (e.g. /usr/bin).
2. Usage
"brightness -l -v" dumps the current display attributes (-v for verbose mode) while "brightness 0.5" modifies the brightness of the main display to half of its max value and "brightness -m 1 1" let a second display become shiny. Just play little bit around.
3. Automatically launch
Sure, OS X provides different ways to launch a program automatically. If you are an enthusiast, feel free to use the one you prefer and stop reading, because you are already finished. If you are not that familiar to OS X take the next step as an advice.
An easy way to trigger OS X launching a program automatically is to add the desired program to your Login Items. But, in this case, it will not work the easy way, because we have to launch a so called classic command line utility with a given option. It is not like starting Mail or iCal, which appears as typical applications to OS X. You must start brightness via Terminal by typing "brightness 0.5" (without quotes) to modify the main display brightness to half of its max.
We now use a Launch Agent. Just create a .plist file, e.g. com.brightness.plist, with your favorite text editor. For the lazy ones here comes the template (simply copy and paste):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.brightness</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/brightness</string>
<string>.5</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Save the file in ~/Library/LaunchAgents, if you want brightness to be executed everytime you log in.
You could also use an AppleScript. Copy and paste this code "do shell script "brightness 0.5"" (without the leading and closing quotes) to a new Script. Then choose Save As and enable the Option to make it Execute only. Now add the Script to your Login Items.
Another option is to use a Terminal Script. Copy and paste this code
#!/bin/bash
/usr/bin/brightness 0.5
exit 0
and save it as, for example, brightness.sh. Make the Script executeable and add it to your Login Items.
That's it. Comments are welcome.

Thanks. Works great. I made a ScriptBundle and a User Agent (launchd) . So if someone sets the display brightness to maximum, it automaticaly corrects it at next login.
The ScriptBundle contains your mentoined command line utility and the following applescript:
do shell script quoted form of (POSIX path of (path to resource "brightness")) & " 0.7"
Be aware of the space in " 0.7" or whatever value you have set.

Similar Messages

  • Cannot adjust display brightness via F-keys nor Preferences

    After updating Mavericks to 10.9.4, I cannot adjust the display brightness. Using the F1-2 keys will show the brightness icon that usually pops up. However, it's stuck and nothing happens when I press either F1 or F2 (the brightness keys).
    I tried going into Preferences and adjust the brightness from there. "Automatically adjust brightness" is not checked and when I drag the slider, it slides back to where it initially was.
    How can I fix this problem?
    Thank you in advance,
    Filip

    Hello Gnazty,
    Thanks for using Apple Support Communities.
    I'd like you to reset your SMC and PRAM as the articles below describe:
    OS X Mavericks: Reset your computer’s PRAM
    http://support.apple.com/kb/ph14222
    Intel-based Macs: Resetting the System Management Controller (SMC)
    http://support.apple.com/kb/HT3964
    Take care,
    Alex H.

  • How to adjust display brightness in nokia 5130 XM

    Hi,
    i want to reduce the display brightness at night times.
    how to adjust display brightness in nokia 5130 XM
    Im not able to find any options for it

    no other way? :-(
    Even 1650 and 2626 models have the option to adjust the brightness.

  • OPTION to adjust display brightness on nokia asha ...

    Hi NOKIA Representative,
    Please provide the support and option to adjust display brightness on NOKIA ASHA 200 in the next software update. (I have NOKIA 200 V11.56  showing manfacturing date 26-03-12).
    Adjustment of display brightness is very basic and important feature in any phone, how come NOKIA forgot it in this model (NOKIA ASHA 200) ??
    Thanks,
    Raven777

    The manual display brightness option should be added to the device in the 11.81 (or newer) SW updates - so try updating your phone SW. 
    http://www.microsoft.com/en/mobile/nokia-x-updates/
    http://www.microsoft.com/en/mobile/nokia-x2-update/
    http://www.microsoft.com/en/mobile/asha-software-update/
    http://www.microsoft.com/en/mobile/support/software-update/wp8-software-update/
    http://www.developer.nokia.com/Community/Wiki/Nokia_firmware_change_logs
    https://twitter.com/LumiaSWUpdates

  • Adjust display brightness in X3

    How do I adjust the display brightness in Nokia X3. I searched everywhere I could but couldn't find an option to change the brightness.     

    this cant be changed on this model
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • Cant adjust my brightness setting after updating window 8.1

    My comp cant adjust its brightness and its super bright help please?

    Hi,
    How to Find the HP Model Number and the HP Product Number or let HP automatically find your PC model number and HP network attached printers.
    There are numerous driver updates posted under Windows 8.1
    Start with the chipset then reboot and apply the others.
    See if you then can adjust the brightness via the Windows 8 settings then the Intel Control Panel Display.
    Try the firmware update posted under Windows 8 if all else fails.
    HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
    HP Photosmart Premium C309G, HP Photosmart 6520
    HP Touchpad, HP Chromebook 11
    Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
    Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
    Windows 7/8 UEFI/Legacy mode, MBR/GPT

  • (SOLVED) Display brightness disappeared from Power Options in Vista, Lenovo G530

    Hello board,
    My system Lenovo G530 product ID 444638U
    I used to be able to adjust display brightness in Vista from Control Panel > Power Options. I could set how bright when on battery and how bright when on AC. Also, it used to be that when I unplugged power cable it would automatically adjust my brightness according to those settings. Now, nothing happens when I unplug power cable, not even a beep.
    Possible problem is as follows, but let's keep an open mind to other things as well. I spilled beer on keyboard recently. ONLY on keyboard I am sure. I replaced keyboard with something that fits but something that isn't made for my laptop, has different arrangement of Fn+ keys. Basically ever since the beer accident and ever since I replaced keyboard I had this brightness issue.
    Please help me solve this.
    -Alex
    Solved!
    Go to Solution.

    I solved this problem..
    Solution is to upgrade the BIOS to latest version. I am not sure actually whether latest BIOS had the needed fix or not, or it was just the process of updating the BIOS that solved this issue.  But no doubt, after flashing the BIOS, display brightness function reappeared!

  • HT3924 Adjusting the brightness doesn't work

    This article states "Use the keyboard of the iMac in TDM to adjust display brightness" but this does nothing. It can adjust the sound but the brightness keys don't do anything. The display stays at full brightness.
    Does anyone have any ideas?   

    I figured it out! You can only adjust the brightness if you are logged in on the iMac. So you have to unplug the external card or MacBook, log in, then plug it back in. Then you can adjust the brightness until the screen saver comes on...

  • How do you adjust the brightness on a Thunderbolt Display

    How do you adjust the brightness of a Thunderbolt Display attached to an iMac ?

    I had this peculiar ‘issue’ hooking up to my MacBook Retina when my Thunderbolt Display was delivered but Applecare  - thanks Andrew - got me there. It seems daft!
    The Thunderbolt Display Brightness slider IS there – you just have to know how to make it show up.
    At initial set-up of the Thunderbolt Display [or if the Brightness slider is ever not visible in the System Preferences> Thunderbolt Display window], so long as the Thunderbolt [external] Display and the Macbook Display are ‘mirrored’ I can control the Thunderbolt [external] Display via my MacBook Retina Brightness keys [F1 & F2] – or by the Brightness slider that THEN appears in my System Preferences>Thunderbolt Display window. Once set up the Thunderbolt Display System Preferences Window continues to show the Brightness slider but I occasionally lose it if my MacBook has been disconnected from the Thunderbolt Display for some time – and I then have to start over.
    So:-
    Apple menu >
    System Preferences>
    Displays>
    Click Arrangement [at the top]
    Click Mirror Displays [at the lower left]
    That then gives me-at-least a Brightness slider on the System Preferences> Thunderbolt Display window [as well as on the Built In Retina Display window] and I can then adjust them independently.
    Oddly, having set this up just once the Brightness slider then remains on my Thurnderbolt Display and I can control it [and my MacBook Retina Display independently]. Occasionally I lose it again and have to start over.
    Hope this works for others.

  • How do I turn off "Automatically adjust brightness" on Mountain Lion using AppleScript

    I'm new to Mac, Applescript and Automator and I'm trying to make a automation for when I perform on stage and found a script to set the brightness all the way up but can't find a script to disable "Automatically adjust brightness". Any help would be appreicated.

    You could even both “set the brightness all the way up” and “disable Automatically adjust brightness” with just one and the same script:
    tell application "System Preferences"
        -- launch
        -- activate
        set current pane to pane id "com.apple.preference.displays"
        reveal anchor "displaysDisplayTab" of current pane
        tell application "System Events"
            tell process "System Preferences"
                tell group 1 of tab group 1 of window 1
                    set value of slider 1 to 1.0 -- max
                    tell checkbox 1
                        if value is 1 then click
                    end tell
                end tell
            end tell
        end tell
        quit -- optional
    end tell

  • Windows can not adjust the brightness on this display

    I have a Toshiba Satellite LX835-D3300 ( Serial #ZC119804Q )
    I want to brighten my display, but it tells me..... Windows can not adjust the brightness on this display.
    In my HELP section on my computer it tells me to...
    Tap or click PC and devices, then tap or click Display
    Make sure the Adjust my screen brightness automatically slider is turned on
    Get the best display on your monitor - Microsoft Windows Help
    (If you don't want the screen brightness to change automatically, tap or click the Adjust my screen brightness automatically slider to turn it off.)
    Tap or click Apply.
    I do not have that.
    I notice that if I go to the side of my screen and then click on Devices, click on projects... "Second Screen" is showning
    I clicked on it and then I went and clicked on PC screen only and it is highlighted, but when I go back to it, it stills shows "Second Sreen"
    Please help me. What am I doing wrong 

    All-in-One LX835-D3300
    Downloads here.
    Have you upgraded to Windows 8.1? If so, did you follow these instructions?
       How to Update from Windows 8 to Windows 8.1
    -Jerry

  • Program to automatically adjust brightness dependent on power source?

    I just bought a MacBook Pro and would love to have my screen brightness adjust automatically based on whether or not the machine is plugged in. I find that the first thing I do when I plug it in or unplug it is adjust the brightness. I like the screen at full brightness when it is plugged in but on a lower setting when running on battery power.
    You would think that the Energy System Preference would include these settings. Does anyone out there know of such a beast???
    Thanks,
    Frank

    It's in the Energy Saver Preference - battery then
    click options - there is a box.
    I am aware of that setting: "Redcue the brightness of the built-in display when using this power source"
    However, what I am looking for is something that will allow me to specify EXACTLY how bright I want the display to be when it is plugged in and how bright I want it to be when it is not plugged in. The checkbox provided in the Energy Saver preference does not give me any control. How much is it reducing it? What if I had already manually set it low? Will it reduce it further? The checkbox is basically useless.
    Thanks anyway,
    Frank

  • Automatically adjust brightness way too aggressive

    I've noticed in low light situations, my new MacBook is almost constantly adjusting the screen and keyboard brightness. It's highly distracting. I've got around the problem by simply turning off "Automatically adjust brightness as ambient light changes" in Displays, but I'd like to know if anyone else has this problem.
    If it's unique to mine, I should probably get it fixed...
    Message was edited by: sdfisher

    It is just how things are. However, some sort of software fix could probably improve it! I own another monitor with a light-sensor, and these just seem to be sensitive, especially in low light.
    Take in considerations that it monitors the light continuously. If you are in a dark room, you will be lit by the display. So if you move around, the amount of light on you (and thereby the amount of light sensed by the sensor) will change. Resulting in some weird behavior.
    So as you figured out yourself, turning it off gets the best result. Luckily it is easy to change the backlight of the display and keyboard.
    - Have a nice day

  • Automatically adjust brightness - Missing

    I have a user complaining of the brightness level changing continuously. I researched and identified Automatically adjust brightness needed to be disabled. When I went to disable it, I found it was missing. I researched that, but couldn't find anything about that. I did find that older iMac models wouldn't have that feature, but we purchased this hardware last year. Is that too old? Anyone have any ideas?
    - OS X version: 10.9.4 (13E28)
    - iMac 27-inch , Late 2013
    - NVIDIA GeForce GT 755M 1024 MB

    Where did you look to disable the feature.  It's in the System/Displays/Display preference pane:
    If the checkbox is not there Boot into the Recovery volume (boot with the Command + R keys held down), select Disk Utility and repair disk permissions and the disk.  Reboot normally and try again  If that fails reboot into the Recovery volume again and reinstall the system.

  • How to adjust the brightness of a second display connected to iMAC 2012  by Apple Mini DisplayPort to Dual-Link DVI Adapter?

    How to adjust the brightness of a second display (Dell 3007WFPHC 2560x1600 dpi) connected to 27 inch iMAC 2012 through thunderbolt port by an Apple Mini Display Port to Dual-Link DVI Adapter?

    Macs control computer by USB.  With a non-Apple display, you will have to use the brightness control on the display.

Maybe you are looking for

  • HT1904 how do we create an Apple ID for our 10 year-old daughter?

    how do we create an Apple ID for our 10 year-old daughter?

  • Insert record in master detail relationship

    Hi, I have the following situation. I have two tables (master and detail in 1:1 relationship). What I want to do is to skip through the master table and insert a record into the detail table containing only the id of the master table (foreign key col

  • Powerbook as display/HDD for Powermac????

    I am wanting to know if I can buy a Powermac and effectively use my Powerbook Ti as display and hardrive.?? Is this possible.? I am quite happy with the 15" LCD display of my Powerbook but the hardware needs updating. I want to buy a Powermac G4 and

  • Linux client - cannot connect to JServer

    Server with database - Oracle 8.1.7 on Windows 2000 Client - Linux RedHat 7.2 When I trying to connect to JServer using sess_sh: sess_sh -u arseniy -p mypasswd -s sess_iiop://199.58.1.113:2481:orcl I get this error message: javax.naming.Communication

  • How to call other execs from java application

    What is the best way to make a call to execute an external executable written in another language (i.e. c++ or ada95) from within a java application?