If you want to change the screen brightness in Ubuntu (I can’t change it using the keyboard shortcuts or the Ubuntu Power Management menu), open a terminal and execute the following:
sudo setpci -s 00:02.0 F4.B=xx
Where xx is the desired brightness in hex ranging from 0 (brightest) to FF (no brightness at all). I usually change it to E0 when working on battery.
Cheers!
THx – looks much better now.
It gives me such an answer, what should I do?
setpci: Warning: No devices selected for `F4.B=E0′.
Are you trying to do this on a desktop? I have only tested this on laptops and I believe it is different for desktops. Alternatively, you could use xgamma to change the brightness:
xgamma -gamma .75Let me know if it works.
This reduces the brightness by 25 percent.
Thank u..
I’m using laptop, HP ProBook 4510s
But the xgamma thing helped me! Thanks!
But still, the white color is super bright compared to others while using xgamma, of course it’s logical… so it doesn’t solve the problem with real brightness
Sorry it took me so long to reply. The problem you are having is that you are not selecting the right device (meaning, 00:02.0 is not your VGA controller). First, see the list of the devices installed on your machine with
lspciIn my case, I get:
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09)Hence I execute the command with 00:02.0 as my device. So make sure you are pointing to the right device and then execute:
sudo setpci -s xx:xx.xx F4.B=xxTry it out and let me know how it goes.
The advice worked very well, and solved a big problem.
Many thanks !!!
It worked on my Lenovo B450. Thanks to the writer of this post!!
me, too.
thank you.
This worked for me.
Short note though, 0 is hexadecimal for completely black, so when i tried that at first, my screen went dark. Then I tried FF (which means white) instead, and got 100% backlight! So your explanations of those numbers are really opposite!
But at least this command solved my problem, thank you so much!
Well, on my system it works as I explained it, but it could always change from one environment to another. Thanks for pointing it out, though!
Hello. I had the same problem with my toshiba laptop, but solved it with your advice. I would like to ask you something… how did you know the F4.B numbers did the magic????? where can a list be found? what other type of problems could be solved with the setpci????
thanks a lot!
Hello sudo setpci -s 00:02.0 F4.B=xx with this comand i can control my intesity but 0 is to big =A1 still to bright whats next ? or what;s the list for 0 to FF A1 still to bright
I belive the darkest setting possible is 01 – not using any letters, just numbers.
Worked on my Acer Aspire One!
Many thanks!!
I’m not sure if it changes from distro to distro, but on my computer 00 is the brightest and FF is the darkest.
After i set my brightness when i restart its’ back to normal is there any thing to keep it this way without having to go to terminal and type again and again ?
You could add it as part of your user’s login script to make it permanent.
How do you do that?
Lifesaver. Now I ask myself, why wasn’t this on the first website I looked, but buried under unanswered threads?
Thanks. Knew the command. Didn’t know what it did
Thanksss.
It worked on my toshoba laptop..
[...] 直到某次重启发觉引导界面很亮- – 各种Google之后找到一篇blog及其评论里比较详细的介绍了两种命令行调节屏幕亮度的方法 [...]
thanks! it works for me
…just install ubuntu 11.04, it started dimly, no brightness at all, f…; no problem with all previous versions.
I have a HP Pavilion Laptop and tried every command here but continue getting errors. It either says “invalid value” “bash: syntax error near unexpected token ‘newline’” or it acts as if I didn’t enter a command and erases the line. Any ideas?
screen brightness problem during the installation of ubuntu 11.04 on ACER laptop .
if any solution plz suggest ,Fn +key not work.
screen brightness problem during the installation of ubuntu 11.04 on ACER 4735
laptop 3RAm ,core2due 2.2Ghz.
if any solution plz suggest ,Fn +key not work.
I’m running an Ubuntu 11.04 from command line .. haven’t installed X yet .. Worked like a charm
could someone put together a script which could be wired to Fn+ arrow keys?
So far this is the onlz soultion that worked for me, great.
hey! can you give me a list of possible code such as middle brightness? brightest? darkest? what codes are available in setting brightness? E0 is good! thanks
Counting in hex is like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1a, 1b, 1c, 1d, 1e, 1f, 20
Basically this just means for every place you have 16 numbers instead of 10.
So instead of counting from 0-9 you count from 0-f
thanks a lot!
awesome article
xgamma can be improved to produce almost full backlight by replacing .75 with .99 so:
xgamma -gamma .99
although thanks so much, this has helped enourmously
I have same problem with my vaio vpccw17fx ! I found the code for my VGA Nvidea but still this command doesn’t work
does any one know why it is like this? how can I reduce the brightness?
Thanks.
Nice one! Works on my Samsung X520, too!
Thanks!
i’m using compaq presario cq35 ubuntu 11.04.
this adjusted my screen / display brightness.
thank you very much!
Well, this solution did not work in my laptop. (Ubuntu 11.04 on Dell Inspiron 1464).
What I wanted to do was to set the display brightness to a value that I need at the startup. So I wrote the folloing script to obtain that.
http://blog.ishans.info/2011/09/25/set-brightness-automatically-at-the-startup-in-linux/
Using this same script (by editing it to pass the brightness level as an argument) you’ll be able to set the display brightness from the terminal.
If you need any help, feel free to contact me from ishanishans[dOt]info
my email address is ishan[at]ishans[dot]info. Above post doesn’t correctly show it :s
under “power management” adjust your preferred settings and then authenticate no need to use the terminal and sudo et al…
You rock!!
Thanks for sharing this.
I have been looking for something like this forever!! All the other forums and articles state the obvious ways to do it that were clearly not working..
waste ubuntu………………………how to change screen brightness……
ubuntu its worst compare to windows
[...] within Ubuntu: ———————- https://help.ubuntu.com/11.04/ubuntu…dimscreen.html http://wilmor24.wordpress.com/2010/0…-ubuntu-10-04/ ———————- Let us know if this [...]
xgamma trick worked perfectly! i’ve been searching a solution for this for a lot of time. thanks a lot! great job!
How can that command modified to adjust a second screen?
Thank you
AAAAA….I can see again…not blind anymore from the screen…thank you a lot…
Thank you for the great tip. Now, I have a screen on/off button on my laptop:
Here are the steps:
1. Change owner of related config file so no need to execute as root:
sudo chown user.user /sys/devices/pci0000\:00/0000\:00\:02.0/config
(got it executed after reboot by putting that in /etc/rc.local)
2. Create a script:
toggle_screen.sh:
if [ -e /tmp/blank_screen ]; then
setpci -s 00:02.0 F4.B=ff
rm /tmp/blank_screen
else
setpci -s 00:02.0 F4.B=00
touch /tmp/blank_screen
fi
3. Add a custom shortcut key for the script in “System>Preferences>Keyboard Shortcuts”
thanks for the post it helped out alot!
I used this to find my VGA controller:
‘lspci’
Then to change the brightness used:
‘sudo setpci -s xx:xx.x F4.B=xx’
Thanks!
Alternatively, you could use ‘xrandr’ to modify screen brightness settings. Managed to change the brightness on my external monitor using this method. Mine doesn’t seem to have a pci entry. As detailed here: http://joeltong.org/blog/?p=166