The way you can accomplish this
- Brightness control program (can be installed via Homebrew or compiled from source)
- A per user bash script that set's the brightness
- Script Added to
~/Library/LaunchAgents and loaded with
There is an AppleScript method that you can use instead of using the brightness program reference above. I am not a fan of this method because I have not found AppleScript to be as reliable as bash (things break when Apple does updates). Scroll to the bottom for details.
If you have Homebrew, issue the command
brew install brightness. If compliling from source, download from the link provided then compile.
cd /brightness ---- (or whereever you downloaded the source)
sudo make install
Test it out by issuing some brighness commands:
brightness 1 <------- set to 100%
brightness .5 <------- set to 50%
Write a bash script to be executed when you log in
sleep 20 # I put this here because I find lauchd needs some "time"
Do this for each user and place the script in an easily accessed location. For example, create a "scripts" directory in each user's home directory:
This is just an example, you can place the script anywhere you like, but remember, you need one that is executable by each user. Speaking of "executable" make sure you set the permissions of the script to execute -
chmod +x set_brightness.sh
Be sure to test out by executing the script directly from the command line by calling it:
Your screen brightness should change to the setting in the script(make sure you change the setting manually first to make sure you are not changing it to what it already is).
Create a .plist file and Load to launchd
Your .plist will execute every time you log in, so it must be located in the ~/Library/LaunchAgents directory. As for the filename, my preference is to use something like the following:
The .plist should look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<string>/Users/<username>/<location of script>/set_brightness.sh
Load the .plist to launchd
launchctl load com.user.brightness.plist
Do this for each user so that every time the user logs in it will execute the bash script setting the brightness automatically.
Alternative Method (for 5K monitors)1
You can also do this via AppleScript and skip the brightness program altogether (I tested this on a non-5K iMac running 10.11.6 and it works).
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
tell application "System Events"
set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 0.5
Save this AppleScript in the same way as described above.
Make this change to your .plist (relacing Program with ProgramArguments):
Adapted from this post: Is it possible for an Applescript to dim/up 0%/100% screen brightness on OSX 10.9 Mavericks when connected to external display?