PDA

View Full Version : Controlling Screen Brightness using C/C++



hthakar
June 29th, 2009, 01:13 PM
Hello,

I am developing a GUI in Ubuntu 9.04 using QT (C++). I need to control the screen brightness using a slide bar.

I don't have any idea how to do this. Googling gave me this blog

http://mankikannan.blogspot.com/2008/01/more-linux-fun-screen-brightness.html

This states that there should be a file in /sys/class/backlight/acpi_video0/brightness but after looking i just found an empty folder /sys/class/backlight.

I will appreciate any help.

Thank you,
Harsh.

PmDematagoda
June 29th, 2009, 02:31 PM
There are already applications that do this, two examples are PowerDevil(written in Qt) and Gnome Power Manager(Using GTK+). Perhaps you should look at the source for these applications.

hthakar
July 1st, 2009, 07:20 AM
I found the brightness file in /proc/acpi/video/VID1/LCD. On opening the file through text editor it says <not supported>.

has Ubuntu 9.04 stopped supporting this file? I am still going through the code for PowerDevil.