11

I have installed Ubuntu 16.04 TS on my laptop and i have connected my laptop to an external monitor via HDMI cable. I can easily change the brightness of the screen of the laptop but that does not affect the brightness of the external monitor. Is there any way to change the brightness of the external monitor as well?

21

Its very easy to do via command line. Type the following command in terminal.

xrandr -q | grep " connected"

You will get something like this

LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm

VGA1 connected primary 1366x768+1366+48 (normal left inverted right x axis y axis) 413mm x 234mm

I am using an external monitor. If you want to reduce the brightness of external screen just type

xrandr --output VGA1 --brightness 0.5
6

The brightness controller mentioned before is now version 2. The original simple version is available using the following steps with support for up to 4 monitors. Tested working without issue on Ubuntu 14.04

sudo add-apt-repository ppa:apandada1/brightness-controller
sudo apt-get update
sudo apt-get install brightness-controller-simple

Enjoy!

  • Works great on Ubuntu 18.04. Allowed me to dim the external more than is possible through the buttons on the monitor. – Garrett Jul 7 at 21:39
4

I have finally found a package, which adjust the brightness of secondary external monitor, which is connected with HDMI.

The package is called as Brightness Controller

In order to install it,

sudo apt-get install brightness-controller

After it is installed, primary is the first screen and the secondary is the external monitor.

enter image description here

2

Brightness is a hardware thing. You can only adjust it by using the external monitor's buttons and integrated interface.

You can do so on the laptop because this hardware is internally wired to a PCI or I²C bus.

To "dim" your external monitor, you can use a program like f.lux, who will remove some colors (blue, mainly) from the GPU output. The result is that the image will look less "aggressive" for your eyes.

You can also try to hack the monitor, using a PIC or AVR chip to emulate the right keypresses (or more, if you reverse engineer a bit) for brightness change.

  • 1
    Thank you for your answer. After my researches, I have found that there is a software packaga ddcontrol, which makes what I want to achieve. However, with ddcontrol, one can only change the brightness of the monitor when it is wired with I2C (VGA or DVI). In my case, i am looking for something similar for the monitor, which is wired with HDMI. – Ad Infinitum Mar 20 '17 at 14:10
  • Thanks for making me discover ddcontrol ! Sadly I think that there is no protocol defined over HDMI to handle this kind of commands .... EDIT : My bad, seems tha there is one : elinux.org/CEC_(Consumer_Electronics_Control)_over_HDMI – Taz8du29 Mar 20 '17 at 20:39
  • Consumer Electronics Control is a very interesting topic :) Thank you make me discover it :) I am still looking for a suitable solution to my "problem". No success but I think there is a solution somewhere. – Ad Infinitum Mar 22 '17 at 8:04
  • I have found the solution. Please read my answer :) – Ad Infinitum Mar 23 '17 at 18:46
0

Rather than plugging in a brightness level for xrandr you can use this bash script to adjust the brightness up or down in steps.

Copy bash script below to a file called bright

Then mark it executable with chmod a+x bright

Bash Script

#!/bin/bash

MON="DP-1-1"    # Discover monitor name with: xrandr | grep " connected"
STEP=5          # Step Up/Down brightnes by: 5 = ".05", 10 = ".10", etc.

CurrBright=$( xrandr --verbose --current | grep ^"$MON" -A5 | tail -n1 )
CurrBright="${CurrBright##* }"  # Get brightness level with decimal place

Left=${CurrBright%%"."*}        # Extract left of decimal point
Right=${CurrBright#*"."}        # Extract right of decimal point

MathBright="0"
[[ "$Left" != 0 && "$STEP" -lt 10 ]] && STEP=10     # > 1.0, only .1 works
[[ "$Left" != 0 ]] && MathBright="$Left"00          # 1.0 becomes "100"
[[ "${#Right}" -eq 1 ]] && Right="$Right"0          # 0.5 becomes "50"
MathBright=$(( MathBright + Right ))

[[ "$1" == "Up" || "$1" == "+" ]] && MathBright=$(( MathBright + STEP ))
[[ "$1" == "Down" || "$1" == "-" ]] && MathBright=$(( MathBright - STEP ))
[[ "${MathBright:0:1}" == "-" ]] && MathBright=0    # Negative not allowed
[[ "$MathBright" -gt 999  ]] && MathBright=999      # Can't go over 9.99

if [[ "${#MathBright}" -eq 3 ]] ; then
    MathBright="$MathBright"000         # Pad with lots of zeros
    CurrBright="${MathBright:0:1}.${MathBright:1:2}"
else
    MathBright="$MathBright"000         # Pad with lots of zeros
    CurrBright=".${MathBright:0:2}"
fi

xrandr --output "$MON" --brightness "$CurrBright"   # Set new brightness

# Display current brightness
printf "Monitor $MON "
echo $( xrandr --verbose --current | grep ^"$MON" -A5 | tail -n1 )
  • Change MON="DP-1-1" to your monitor name, ie MON="eDP-1-1"
  • Change STEP=5 to your step value, eg STEP=2 is less noticeable

Call the script with:

  • bright Up or bright + to increase brightness by step value
  • bright Down or bright - to decrease brightness by step value
  • bright (with no parameters) to get the current brightness level

Hopefully the bash / shell commands can easily be googled for education but if any questions don't hesitate to ask :)

0

If you're using Chrome, try Firefox. It's the strangest thing. My brightness is okay everywhere else on my extended display (downloaded movies, Firefox) but on Chrome the brightness is dull ?!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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