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!
Advertisements

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..
thanks helped me a lot.now i can see screen for longer time
Thank you 🙂
this worked for my desktop
i used it to make my screen brighter and typed
xgamma -gamma 1.5
thank you 🙂
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?
please explain how to do this? This solution works for me however it resets every time I restart.
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 https://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
xrandr –output LVDS1 –brightness 0.65
this works great without modifying the gamma
http://ubuntuforums.org/showthread.php?t=1907928&page=5
that wonked on my sony vaio vpcya17GG running ubuntu 12.04…thanx a ton man….u made my day!!
thanks a lot for your help.
it’s not working. no error. but it didn’t change my brightness screen. my laptop is hp pavillion dv3000.
Did you do ‘lspci’ first to find your VGA Controller?
i have an hp pavillion also and it isnt working for me and yes i checked my VGA controller. i have tried gamma didnt work and i put in the xrandr –output LVDS1 –brightness 0.65 command and it didnt do anything it showed a list so i think this is the wrong command
its not -output, it is –output.
2 dashes
and similarly, it is –brightness
(2 dashes again).
also, if your graphic driver donot support this command, then you are out of luck
awesome mann !!! thnx a lot
thanks alot worked for me……..
xgamma ………………… now its fine!!!
thanks 🙂
1) sudo setpci -s 00:02.0 F4.B=xx //—xx level of bright.
2) xgamma -gamma .75
both worked for me … (where 1 set the brightness and 2nd represent the gamma correction of screen… thx a lot guys
Hello, I’ve tried the “sudo setpci -s 01:00.0 F4.B=E0” command. But nothing happened. What should I do ?
P.S. : the xgamma is working.
These are truly fantastic ideas in regarding blogging. You have touched some good
points here. Any way keep up wrinting.
Thanks!
Please help. After entering lspci I get:
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18)
00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 18)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)
00:1c.2 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 3 (rev 06)
00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06)
00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI M96 [Mobility Radeon HD 4650]
01:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI RV710/730 HDMI Audio [Radeon HD 4000 series]
12:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
13:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 05)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 05)
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 05)
ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 05)
ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 05)
After entering:
sudo setpci -s 01:00.0 f4.b=20
nothing changes. Tried using gamma command:
xgamma -gamma .1
-> Red 0.750, Green 0.750, Blue 0.750
<- Red 0.100, Green 0.100, Blue 0.100
But nothing changes too. What I am doing wrong ?
I also tried:
xrandr –output LVDS –brightness 0.5
but brightness immediately switches back to previous.
[…] De Travail Joue Un Rle Important Dans Les Grands Arrondissements. civiltech.in • Login Change Screen Brightness From Terminal (Ubuntu*10.04) | William Mora Kunena :: Topic: Acheter Cialis Au Maroc (1/1) Comunidad y foro hispano The Elder Scrolls – Skyrim, […]
guys this worked,
0 = 0 51 = 33 102 = 66 153 = 99 204 = CC
1 = 1 52 = 34 103 = 67 154 = 9A 205 = CD
2 = 2 53 = 35 104 = 68 155 = 9B 206 = CE
3 = 3 54 = 36 105 = 69 156 = 9C 207 = CF
4 = 4 55 = 37 106 = 6A 157 = 9D 208 = D0
5 = 5 56 = 38 107 = 6B 158 = 9E 209 = D1
6 = 6 57 = 39 108 = 6C 159 = 9F 210 = D2
7 = 7 58 = 3A 109 = 6D 160 = A0 211 = D3
8 = 8 59 = 3B 110 = 6E 161 = A1 212 = D4
9 = 9 60 = 3C 111 = 6F 162 = A2 213 = D5
10 = A 61 = 3D 112 = 70 163 = A3 214 = D6
11 = B 62 = 3E 113 = 71 164 = A4 215 = D7
12 = C 63 = 3F 114 = 72 165 = A5 216 = D8
13 = D 64 = 40 115 = 73 166 = A6 217 = D9
14 = E 65 = 41 116 = 74 167 = A7 218 = DA
15 = F 66 = 42 117 = 75 168 = A8 219 = DB
16 = 10 67 = 43 118 = 76 169 = A9 220 = DC
17 = 11 68 = 44 119 = 77 170 = AA 221 = DD
18 = 12 69 = 45 120 = 78 171 = AB 222 = DE
19 = 13 70 = 46 121 = 79 172 = AC 223 = DF
20 = 14 71 = 47 122 = 7A 173 = AD 224 = E0
21 = 15 72 = 48 123 = 7B 174 = AE 225 = E1
22 = 16 73 = 49 124 = 7C 175 = AF 226 = E2
23 = 17 74 = 4A 125 = 7D 176 = B0 227 = E3
24 = 18 75 = 4B 126 = 7E 177 = B1 228 = E4
25 = 19 76 = 4C 127 = 7F 178 = B2 229 = E5
26 = 1A 77 = 4D 128 = 80 179 = B3 230 = E6
27 = 1B 78 = 4E 129 = 81 180 = B4 231 = E7
28 = 1C 79 = 4F 130 = 82 181 = B5 232 = E8
29 = 1D 80 = 50 131 = 83 182 = B6 233 = E9
30 = 1E 81 = 51 132 = 84 183 = B7 234 = EA
31 = 1F 82 = 52 133 = 85 184 = B8 235 = EB
32 = 20 83 = 53 134 = 86 185 = B9 236 = EC
33 = 21 84 = 54 135 = 87 186 = BA 237 = ED
34 = 22 85 = 55 136 = 88 187 = BB 238 = EE
35 = 23 86 = 56 137 = 89 188 = BC 239 = EF
36 = 24 87 = 57 138 = 8A 189 = BD 240 = F0
37 = 25 88 = 58 139 = 8B 190 = BE 241 = F1
38 = 26 89 = 59 140 = 8C 191 = BF 242 = F2
39 = 27 90 = 5A 141 = 8D 192 = C0 243 = F3
40 = 28 91 = 5B 142 = 8E 193 = C1 244 = F4
41 = 29 92 = 5C 143 = 8F 194 = C2 245 = F5
42 = 2A 93 = 5D 144 = 90 195 = C3 246 = F6
43 = 2B 94 = 5E 145 = 91 196 = C4 247 = F7
44 = 2C 95 = 5F 146 = 92 197 = C5 248 = F8
45 = 2D 96 = 60 147 = 93 198 = C6 249 = F9
46 = 2E 97 = 61 148 = 94 199 = C7 250 = FA
47 = 2F 98 = 62 149 = 95 200 = C8 251 = FB
48 = 30 99 = 63 150 = 96 201 = C9 252 = FC
49 = 31 100 = 64 151 = 97 202 = CA 253 = FD
50 = 32 101 = 65 152 = 98 203 = CB 254 = FE
255 = FF