My laptop has keyboard buttons for adjusting screen brightness. After a Debian Squeeze re-installation, they don't work no more.
[laptop] Acer TravelMate 6592; I use Fn< to decrease the brightness and Fn> to increase it.
debiangnomelaptoplinux
My laptop has keyboard buttons for adjusting screen brightness. After a Debian Squeeze re-installation, they don't work no more.
[laptop] Acer TravelMate 6592; I use Fn< to decrease the brightness and Fn> to increase it.
You might want to give this a try:
$ sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
Change the value between 0-15 I believe to make it brighter or dimmer.
You might need to change these as well:
$ sudo echo 950 > /sys/class/backlight/intel_backlight/brightness
$ sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
$ sudo echo 5 > /sys/class/backlight/acpi_video1/brightness
@JosephR. asked this folow-up in the comments and I thought it important enough to incorporate into my answer. If you want to expose this capbility to change brightness from the command line to regular users (the above echo ... > /sys/...
is only accessible to root).
There is a package you can install called xbacklight
which will allow user's to also change the brightness from the command line.
The package is available on Fedora and Ubuntu via repositories so just do either of these commands to install it:
# Ubuntu/Debian
$ sudo apt-get install xbacklight
# Fedora/CentOS
$ sudo yum install xbacklight
To use it:
# backlight 50%
$ xbacklight -set 50
# backlight 100%
$ xbacklight -set 100
$ xbacklight --help
usage: xbacklight [options]
where options are:
-display <display> or -d <display>
-help
-set <percentage> or = <percentage>
-inc <percentage> or + <percentage>
-dec <percentage> or - <percentage>
-get
-time <fade time in milliseconds>
-steps <number of steps in fade>
Again more follow-up to @JosephR. asking about this in a comment. It may seem like you as the user have elevated privileges to change the /sys/class/backlight/...
when you use your laptops function keys (on my Thinkpad I use Fn+Home and Fn+End to change brightness). But you aren't really ever directly interacting with the /sys/class/backlight/...
in the way that you think.
You're manipulating it indirectly through D-Bus. D-Bus is allowing you to manipulate this structure, org.freedesktop.Hal.Device.KeyboardBacklight
, and HAL is allowing the privilege to do so. You can see this on my Fedora 14 system like this:
$ grep -i backlight /etc/dbus-1/system.d/*
/etc/dbus-1/system.d/hal.conf: send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
/etc/dbus-1/system.d/hal.conf: send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
In the file hal.conf
:
<!-- Only allow users at the local console to manipulate devices -->
<policy at_console="true">
...
<allow send_destination="org.freedesktop.Hal"
send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
You can even mess with it from the command line via D-Bus like this. You can query the current value:
$ dbus-send \
--print-reply \
--system \
--dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer_backlight \
org.freedesktop.Hal.Device.LaptopPanel.GetBrightness | \
tail -1 | \
awk '{print $2}'
Which returns the value:
15
Even cooler, you can mess with it like this (the bit int32:10
below is setting brightness to "10"):
$ dbus-send \
--print-reply \
--system \
--dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer_backlight \
org.freedesktop.Hal.Device.LaptopPanel.SetBrightness \
int32:10 #2&>1 > /dev/null
You can see that we changed the brightness:
$ cat /sys/class/backlight/acpi_video0/brightness
10
I struggled with a similar issue in Debian 9, installed on a Lenovo G40-30 Laptop. I went into Hibernate/Sleep and trying to initiate again the screen didn't show up although everything seemed working.
The solution is actually quite simple. It seems Linux OSs, in particular Debian and Ubuntu need at least a 4+GB swap partition for Hibernate/Sleep to work properly. If you installed with "default" configuration it will create a Swap the same size of your actual RAM (in practice a little less). So if you have a laptop with less or equal to 4 Gb RAM and installed "default" configuration, you are probably trying to solve this issue.
Swap allocation in Linux work in two ways:
in the form of a SWAP PARTITION in your hardrive.
in the form of a SWAP FILE.
YOU CAN CREATE THE SWAP
FILE AS FOLLOWS:
sudo swapon --show
shows if you have enabled the swap option. If not look up how to do this.
sudo fallocate -l 1G /swapfile
sets the size of the swap you add to 1Gb, change to the value you need.
sudo chmod 600 /swapfile # sets the file to be owned by root
sudo mkswap /swapfile # mkswap tool to allocate swap in the file
sudo swapon /swapfile # activate the swap
sudo nano /etc/fstab # open the file to make changes permanent
Add the line /swapfile swap swap defaults 0 0
to the file /etc/fstab
:
sudo swapon --show # show if its working
sudo free -h # show Memory and Swap
IF YOU WANT TO UNDO CHANGES JUST:
sudo swapoff -v /swapfile
remove the line from /etc/fstab
file: /swapfile swap swap defaults 0 0
sudo rm /swapfile # remove the swap file
SWAP SIZES ACCORDING TO RAM:
I can indicate the following table with some recommended
SWAP
sizes according to your RAM. Last 3 columns are SWAP
spaces:
RAM No hibernation With Hibernation Maximum
1GB 1GB 2GB 2GB
2GB 1GB 3GB 4GB
3GB 2GB 5GB 6GB
4GB 2GB 6GB 8GB
5GB 2GB 7GB 10GB
6GB 2GB 8GB 12GB
8GB 3GB 11GB 16GB
12GB 3GB 15GB 24GB
16GB 4GB 20GB 32GB
24GB 5GB 29GB 48GB
32GB 6GB 38GB 64GB
64GB 8GB 72GB 128GB
128GB 11GB 139GB 256GB
256GB 16GB 272GB 512GB
512GB 23GB 535GB 1TB
1TB 32GB 1056GB 2TB
2TB 46GB 2094GB 4TB
4TB 64GB 4160GB 8TB
8TB 91GB 8283GB 16TB
MORE INFORMATION:
you can find thorough information on recommended SWAP sizes according to your RAM in the following link:
How much swap should I take for 1GB to 8TB of RAM on 14.04 or higher?
Credit is due for the table I added here.
Best Answer
Is it a problem of key mapping or a problem of acpi support ?
Check in
/proc/acpi/
if you have some entries like this one :/proc/acpi/video/GFX0/LCDD/brightness
If you find it, try to set a value maybe like this :