How I can change brightness?

Problems with hardware & laptops not being detected or supported during or after install.
AMDx64BT
Posts: 4
Joined: Sat Oct 17, 2009 10:47 am

How I can change brightness?

Post 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.)
jckkeith
Posts: 1
Joined: Wed Feb 24, 2010 11:15 am

Re: How I can change brightness?

Post 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
martini
Posts: 1
Joined: Thu Dec 15, 2011 2:46 pm

Re: How I can change brightness?

Post 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?
;ost_pilot
Posts: 1
Joined: Fri Jan 13, 2012 9:59 pm

Re: How I can change brightness?

Post 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
seppalta
Posts: 449
Joined: Tue Sep 20, 2011 6:09 am
Location: USA
Contact:

Re: How I can change brightness?

Post 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
fabrixx
Posts: 6
Joined: Sun Mar 11, 2012 9:08 pm
Contact:

Re: How I can change brightness?

Post 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
fabrixx
Posts: 6
Joined: Sun Mar 11, 2012 9:08 pm
Contact:

Re: How I can change brightness?

Post 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.
cbhattarai
Posts: 12
Joined: Thu Mar 29, 2012 8:07 am

Re: How I can change brightness?

Post by cbhattarai »

Just simple press the FN button and then the brightness key that might be f6 r any other..
fabrixx
Posts: 6
Joined: Sun Mar 11, 2012 9:08 pm
Contact:

Re: How I can change brightness?

Post 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.
lubuntuman
Posts: 1
Joined: Sat May 05, 2012 7:22 pm

Re: How I can change brightness?

Post 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.
Locked