Ask Your Question

Brightness Adjust on Fedora 17

asked 2012-08-26 02:17:19 -0500

kkvn_lxy gravatar image

Hey all,

I am using Fedora 17 with LXDE. Since LXDE doesn't come with some common functionalities such as volume up and down, I have to do it on my own, but I LOVE doing this since I learn a lot.

I am currently writing a C program to adjust the brightness of the screen (I am working on a laptop). The file /sys/class/backlight/acpi_video0/brightness is the file I need to work on. Although the permission of the file showing:

-rw-r--r--. 1 root root 4096 Aug 25 23:47 brightness

I still have to sudo to save the change. (WHY IS THAT?)In other word, my C program have to setuid to root (0) to gain access to the file. I however fails with just calling seteuid(0). I try GNU's setuid sample code (at here), it still fails.

I have very few knowledge about setuid, so I may be miss-using it. So please give me some idea and direction.

I am open to any other suggestions too.

Thank you so much in advance.

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted

answered 2012-08-26 11:00:40 -0500

skytux gravatar image

updated 2012-08-26 11:01:40 -0500

You don't need to write a new program because it already exists, it is called xbacklight and this is how you install it:

# yum install xbacklight

and this is how you use it, for example:

$ xbacklight -set 70

to lower the brightness 70%.

(This program writes to the file /sys/class/backlight/acpi_video0/brightness that you cited in your post, and no need to be sudo to do that).



edit flag offensive delete link more

answered 2012-08-26 07:20:55 -0500

PaulCarroty gravatar image

You need power-manager (xfce or gnome) or this thread.

edit flag offensive delete link more

answered 2013-11-14 12:56:24 -0500

Anibal Gomez gravatar image

updated 2013-11-14 13:01:07 -0500

chmod 777 permissions to


and install jar file from

i cant paste links

edit flag offensive delete link more

answered 2014-05-09 09:58:49 -0500

Install xbacklight

yum install xbacklight

go to start-up application manager for gnome

$ sudo gnome-session-properties

Add one new by setting the command as

xbacklight -set 50

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-08-26 02:17:19 -0500

Seen: 8,771 times

Last updated: May 09 '14