How do I change screen brightness from a terminal?
Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I change screen brightness from a terminal?
I'm running Ubuntu 11.04 with the Gnome Classic (No effects) display manager. My laptop's brightness keys work. However, when I boot or resume from suspend when using the integrated Intel graphics card the display brightness is turned all the way down, and I have to turn up the brightness using the brightness function keys so I that can see the display. I'd like to automate this by putting a terminal command in a script so I can automatically turn up the screen brightness when the system boots.
I've tried the following commands with no success:
What ever I echo in the brightness file has no effect on the screen brightness, and nothing changes in the /sys/class/backlight/acpi_video0/brightness or actual_brightness files. The contents of these files do change, however, if I change the brightness using the keyboard function keys.
Code:
setpci -s 00:02.0 F4.B=10
Some posts have suggested this command might work, but in my case it has no effect. The contents of the F4 register remain at 00, even if I change the screen brightness with the function keys.
Code:
xbacklight -set 90
Using this command I can change the value of xbacklight (i.e. xbacklight -get shows the new value), but the screen brightness does not change. However, if I change the screen brightness using the keyboard function keys then the value of xbacklight -get shows the new value.
Code:
acpi_backlight=vendor
I've tried putting this command on the linux command line when I boot. Even with this parameter I'm still unable to change the screen brightness from the terminal. This parameter also disables the keyboard brightness function keys.
Any suggestions of anything else I could try to change the screen brightness from a terminal?
I would look under the Gnome keyboard shortcut configuration, if I remember rightly from when I used Ubuntu you can see what command it runs when you press the brightness keys and then you should be able to run that from terminal...
What ever I echo in the brightness file has no effect on the screen brightness, and nothing changes in the /sys/class/backlight/acpi_video0/brightness or actual_brightness files. The contents of these files do change, however, if I change the brightness using the keyboard function keys.
remember you can only echo values 0-24 (0 darkest - 24 brightest). i use a bash script that i run with sudo for this purpose. it takes the brightness level as argument:
Code:
#!/bin/bash
# set screen brightness level
if [ "$#" = "0" ]; then
level= cat /sys/class/backlight/acpi_video0/brightness
echo -n $level
else
echo $1 > /sys/class/backlight/acpi_video0/brightness
fi
I would look under the Gnome keyboard shortcut configuration, if I remember rightly from when I used Ubuntu you can see what command it runs when you press the brightness keys and then you should be able to run that from terminal...
No, there are no keyboard shortcut keys for the brightness controls. I've found some configurable settings under gconf-editor in the Gnome Power Manager, but nothing tells me what Gnome is using to set the brightness.
remember you can only echo values 0-24 (0 darkest - 24 brightest). i use a bash script that i run with sudo for this purpose. it takes the brightness level as argument:
Code:
#!/bin/bash
# set screen brightness level
if [ "$#" = "0" ]; then
level= cat /sys/class/backlight/acpi_video0/brightness
echo -n $level
else
echo $1 > /sys/class/backlight/acpi_video0/brightness
fi
That doesn't work. I can access the acpi brightness file, but any value I try to echo into that file has no effect, e.g:
remember you can only echo values 0-24 (0 darkest - 24 brightest). i use a bash script that i run with sudo for this purpose. it takes the brightness level as argument:
Hotkeys won't work.
(sudo) echo xx>/sys... gives bash: /sys/class/backlight/acpi_video0/brightness: Permission denied
(sudo) echo "xx">/sys... gives the same
btw: brightness has -rw-r--r--
then I installed xbacklight
but no matter what I wrote in commandline (xbacklight -get, xbacklight -set 10, xbacklight -inc 20, ...) nothing happens nor output.
Can someone help me?
I'm working on a Thinkpad Edge something with Linux Mint 17 and cinnamon
Please feel free to correct my english so that I can improve it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.