Brightness on external monitors without OSD.

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Brightness on external monitors without OSD.

Postby viking777 on Thu Feb 28, 2013 1:57 pm

If your Fn brightness keys work on a Linux laptop, you are a very lucky person. Normally it requires either the 'Brightness' applet to be put into your panel or xbacklight commands to be bound to keyboard shortcuts in order to be able to change brightness on a Linux machine. Even these two solutions don't work if you happen to have an external monitor attached to a laptop, it only affects the brightness on the laptop itself. You can obviously adjust this brightness with the screens OSD, but these are so annoying I hate using them. This behaviour has always bugged me and finally I have found a workround for it.

First of all you need xrandr to be installed. This is part of the package 'x11-server-utils' that is available for install through the package/software manager (if you don't already have it). If you have the package then run the command:

Code: Select all
xrandr -q | grep -w connected


I get these results:

Code: Select all
LVDS1 connected 1366x768+1280+256 (normal left inverted right x axis y axis) 344mm x 194mm
HDMI1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 376mm x 301mm


So my monitors are called LDVS1 and HDMI1.

So now in order to adjust the brightness for HDMI1 (the external monitor) I need the following command:

Code: Select all
xrandr --output HDMI1  --brightness 1.0


Or

Code: Select all
xrandr --output HDMI1  --brightness 0.8


In this command 1.0 is maximum brightness and 0.8 is 80% of maximum brightness - I find this is all I need.

Of course trying to remember those commands is not all that user friendly so I suggest you create keyboard shortcuts with those commands in them.

Select 'Keyboard' from the main menu (there are two entries - choose the first). For the 'Name' use something like 'Monitor Brightness Day'. For the command use the first xrandr command above and choose a keyboard sequence that means something to you. Create another command for 'Monitor Brightness Night' and use the second xrandr command above. Obviously you can choose the percentage brightness that suits your monitor - 80% and 100% work for me.

Now all you need to do to switch between day and night brightness is to invoke one or other of the two keyboard shortcuts you just created.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Linux Mint is funded by ads and donations.
 

Re: Brightness on external monitors without OSD.

Postby lordamit on Tue Apr 30, 2013 8:57 am

hi guys,
I wrote this small program that might allow you to easily change display brightness of LVDS1 and VGA1 display devices by default, but that can easily be changed by editing the Brightness.py file.

https://github.com/lordamit/Brightness/

This simply controls brightness using xrandr in the backend, dependency is python WxWidgets for running it.
lordamit
Level 1
Level 1
 
Posts: 5
Joined: Sat Aug 25, 2012 4:29 am
Location: Dhaka, Bangladesh

Re: Brightness on external monitors without OSD.

Postby viking777 on Tue Apr 30, 2013 11:13 am

lordamit wrote:hi guys,
I wrote this small program that might allow you to easily change display brightness of LVDS1 and VGA1 display devices by default, but that can easily be changed by editing the Brightness.py file.

https://github.com/lordamit/Brightness/

This simply controls brightness using xrandr in the backend, dependency is python WxWidgets for running it.


Nice one lordamit, it works for me.

For the beneift of anyone else that wants to try it, copy the code into an empty file, save it as 'brightness.py' or whatever you like, make it executable, then install python-wxgtk2.8 and its 3 dependencies from the package manager. I also had to change the external monitor name from VGA1 to HDMI1 at the beginning of the code
Code: Select all
self.externalName = "HDMI1" #change it according to xrandr output

NB if you don't know what your monitors are called run:
Code: Select all
xrandr -q | grep -w connected

Double click it and select the brightness you want. Clean, simple and nice, it has even got its own cute little panel icon. Well done :D
You could also give it a keyboard shortcut to call it from if you wanted.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Brightness on external monitors without OSD.

Postby lordamit on Tue Apr 30, 2013 6:52 pm

Glad to know that it was of use to someone other than me :D
But reading your response, I realized that I am making the users install too many dependencies. That's not good.

I might change the UI components so that it can be executed without installing any UI related dependencies in Linux Mint :)
lordamit
Level 1
Level 1
 
Posts: 5
Joined: Sat Aug 25, 2012 4:29 am
Location: Dhaka, Bangladesh

Re: Brightness on external monitors without OSD.

Postby lordamit on Thu Jun 13, 2013 5:16 pm

You guys will be pleased to hear that I have vastly modified it.
1. It now can detect the available monitors - whether it is LVDS1 or VGA213 - it will find it.
2. It can increase or decrease number of sliders based on the number of devices available.

https://github.com/lordamit/Brightness/

Please check it out, thanks! :)

Image
Brightness Controller_018 by lordamit, on Flickr
lordamit
Level 1
Level 1
 
Posts: 5
Joined: Sat Aug 25, 2012 4:29 am
Location: Dhaka, Bangladesh


Return to Tutorials / Howtos

Who is online

Users browsing this forum: flieger and 13 guests