Page 1 of 2

How I can change brightness?

Posted: Sun Feb 21, 2010 10:16 pm
by AMDx64BT
Xfce has an applet included in xfce4-power to change the brightness of the monitor. I have tried to open this applet when I was logged in LXDE what doesn't work. Do you know another tool to change the brightness? (It is not necessary to use hotkeys to up and down, I only want to set a fix value.)

Re: How I can change brightness?

Posted: Mon Mar 08, 2010 5:52 am
by jckkeith
Because of the restricted access to the backlight adjustment program this is the most complicated part of the keybinding tutorial. Start by creating a script to adjust screen brightness when called from xbindkeys:

File: /usr/bin/adjust_brightness.sh

# The first argument is whether to increase the brightness (+) or
# decrease the brightness (-).
# The second argument is optional and indicates the step size when
# increasing or decreasing the brightness. The default is 1.
if [ $# -eq 0 ]; then exit 1; fi
bright_file="/sys/class/backlight/dcon-bl/brightness"
mbright_file="/sys/class/backlight/dcon-bl/max_brightness"
while read line; do
brightness=$line
done < <(cat "$bright_file")
while read line; do
max_brightness=$line
done < <(cat "$mbright_file")
step=1
if [ $# -gt 1 ]; then
step=$2
fi
declare -i brightness
if [ $1 = "-" ]; then
if [ $brightness -ne 0 ]; then
brightness=$brightness-$step;
echo $brightness > /sys/class/backlight/dcon-bl/brightness
fi
else
if [ $brightness -ne $max_brightness ]; then
brightness=$brightness+$step;
echo $brightness > $bright_file
fi
fi

Don't worry if you don't understand the above script. You can just copy and paste the contents into the file you create when using the following command:
# nano /usr/bin/adjust_brightness.sh

Now you must make this file executable:
# chmod a+x /usr/bin/adjust_brightness.sh

Open the keybindings file and have the "dim" (c:75) and "bright" (c:76) keys execute the above script:
# nano /home/olpc/.xbindkeysrc

and paste the following before "End of Xbindkeys configuration" :
## Reduce brightness
"/usr/bin/adjust_brightness.sh -"
c:75

## Increase brightness
"/usr/bin/adjust_brightness.sh +"
c:76

Re: How I can change brightness?

Posted: Thu Dec 15, 2011 2:49 pm
by martini
Completely not working:

Code: Select all

cat: /sys/class/backlight/dcon-bl/brightness: No such file or directory
cat: /sys/class/backlight/dcon-bl/max_brightness: No such file or directory
/usr/bin/adjust_brightness.sh: line 20: [: -ne: unary operator expected
Is there another way?

Re: How I can change brightness?

Posted: Sat Jan 14, 2012 2:06 am
by ;ost_pilot
Hi all new to forum.

I am somewhat new to linux and I do not work in IT nor am I a programmer.
I'm just here for the fun of it because I love to tinker.... :D

The solution given above is for an Xfce system if I am not mistaken. Either the poster wrote the Wiki page or it was copied from there. http://wiki.laptop.org/go/Xfce_keybindings
The script given is not clear at all as it is directed towards a Xfce system.

I run Fedora 15 with LXDE. That script can not possibly work on this laptop.
The directories are not correct for Fedora 15. That should be noted on the post.
Also there are other programs/utils that need to be installed for that to work.

I am going to the Fedora Forum to try and solve this issue with help and I will post a solution here.

I believe the title of the post should read.... How to change screen brightness from the "Xfce keybindings - OPLC" Wiki

Hopefully we can resolve this issue for fedora 15 users.

Rick

Re: How I can change brightness?

Posted: Mon Jan 16, 2012 5:13 am
by seppalta
Xfce has an applet included in xfce4-power to change the brightness of the monitor. I have tried to open this applet when I was logged in LXDE what doesn't work. Do you know another tool to change the brightness?
Gnome-power-control adjusts brightness and works in Linux Mint LXDE, but I have had no luck with it in Lubuntu 11.10 .
http://douwil7.100webspace.net/linux/Tuning.html#6

Re: How I can change brightness?

Posted: Sun Mar 11, 2012 9:23 pm
by fabrixx
With Lubuntu 12.04 i was not able to start with full brightness.
I can only increase it by netbook Fn+arrow up key but after startup.

I have also make a script that if i run enable full brightness but if i put in autostart not work

Re: How I can change brightness?

Posted: Sun Mar 11, 2012 10:14 pm
by fabrixx
In Lubuntu 12.04 my bakclight work in reverse mode.. :shock:

Start dark and after 120 secs (or time thai i have setted in power manager) goes up, then when i touch the pad goes dark.

Re: How I can change brightness?

Posted: Thu Mar 29, 2012 8:16 am
by cbhattarai
Just simple press the FN button and then the brightness key that might be f6 r any other..

Re: How I can change brightness?

Posted: Tue Apr 03, 2012 5:35 am
by fabrixx
But start in dark mode and after 120 sec go light until i make an action (reverse mode)

Is i use FN+up arrow keys light stay up but is dark at every restart.

I read a bug about new xfce-powermanager version that fixed it but not work for me after upgrade.

Re: How I can change brightness?

Posted: Sat May 05, 2012 7:39 pm
by lubuntuman
hi,

i'm on lubuntu 12.04. installed ubuntu 12.04 via wubi then "lubuntu-desktop".

the screen brightness/backlight is maximum, and unchangeable.

used fn key with f7 and/or f8 on my keyboard, but no change.
set the power manager brightness value to zero, but no change.
copied the keybindings code into the required xml file, but no change.
installed and tried xbacklight, but no change.

dear lubuntu experts please help, thank you.