Cuando cambio el brillo en la computadora portátil con las teclas de una computadora portátil, el brillo se comporta de manera extraña durante un par de minutos y Xorg consume un 5 % de la CPU durante este tiempo.
Tuve el mismo efecto en mi computadora portátil anterior, que atribuí a su hardware moribundo. Ahora tengo el mismo problema después de un año de uso de mi nueva computadora portátil.
En la primera computadora portátil usé controladores patentados ATI Radeon, y en la actual uso controladores patentados NVIDIA.
Actualmente estoy usando un Kubuntu-dev, pero en la vieja computadora portátil he usado una versión estable.
Encontré un hilo antiguo algo similar en los foros de ubuntu sin ninguna respuesta.
Editar
Intenté ajustar el brillo desde cli (ver aquí y allá) y también usar gui wigdet (estoy en KDE), pero nada funciona:el estado descuidado me libera más rápido, pero no cambia el brillo.
El brillo solo se cambia con las teclas de brillo de la computadora portátil, y lleva un par de minutos completar esa tarea Xorg de CPU del 5 %.
Respuesta aceptada:
¡Resuelto!
$ find /sys -name "max_brightness"
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/max_brightness
/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/leds/phy0-led/max_brightness
/sys/devices/platform/dell-laptop/backlight/dell_backlight/max_brightness
$ cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/max_brightness
4648
$ sudo bash -c 'echo 2000 >> /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness'
# note that now it is brightness - not max_brightness
¡Esto cambia el brillo de inmediato! Igual que antes.
Sin embargo, todavía no sé qué estaba mal.
Editar
La solución se puede programar fácilmente. El único inconveniente:requiere root y no tengo idea de cómo configurar correctamente PolicyKit para prescindir de él.
Editar 2 :
Estoy usando el siguiente script. Tiene dos valores codificados:Max
y BrightnessFile
encontrado en las líneas 17 y 18:
#!/bin/bash
# to get description use the -h flag
# exit after a single error:
set -e
# ================
## default values:
Inc=
Dec=
Set=
Get=false
Max=4648 # max_brightness
BrightnessFile=/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness
Current=`cat $BrightnessFile`
# ===========
## preambula:
PROGNAME=${0##*/}
PROGVERSION=0.01
noColors=false
usage()
{
cat << EO
usage: $PROGNAME [OPTIONS...]
Changes brightness of the laptop.
The value of the max brightness depends on the hardware, and is hardcoded. On my machine it is 4648:
$ find /sys -name "max_brightness"
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/max_brightness
/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/leds/phy0-led/max_brightness
/sys/devices/platform/dell-laptop/backlight/dell_backlight/max_brightness
$ cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/max_brightness
4648
Requires superuser privilages.
Examples:
Increase brightness by 10 percents:
$PROGNAME --inc 10
Decrease brightness by 10 percents:
$PROGNAME --dec 10
Set brightness to 10 percents:
$PROGNAME --set 10
optional arguments:
EO
cat << EO | column -s\& -t
-i, --inc & increase brightness (in percents)
-d, --dec & decrease brightness (in percents)
-s, --set & set brightness (in percents)
-g, --get & print current value (in percents)
-G, --GUI & ask password with kdialog
-h, --help & show this output
-v, --version & show version information
EO
}
SHORTOPTS="hvi:d:s:g"
LONGOPTS="help,version,inc:,dec:,set:get"
ARGS=$(getopt -s bash --options $SHORTOPTS --longoptions $LONGOPTS --name $PROGNAME -- "[email protected]")
eval set -- "$ARGS"
while true; do
case $1 in
-i|--inc)
Inc=$2; shift;;
-d|--dec)
Dec=$2; shift;;
-s|--set)
Set=$2; shift;;
-g|--get)
Get=true;;
-h|--help)
usage; exit 0;;
-v|--version)
echo "$PROGVERSION"; exit 0;;
--)
shift; break;;
*)
shift; break;;
esac
shift
done
# =========
## program:
if $Get; then
CurrentRelVal=`bc <<< "$Current*100/$Max"`
echo "Current brightness: $CurrentRelVal%"
exit 0
elif [ -n "$Inc" -a $Inc -eq $Inc 2>/dev/null ]; then
IncAbsVal=`bc <<< "$Current+$Inc*$Max/100"`
sudo bash -c "echo $IncAbsVal >> $BrightnessFile"
exit
elif [ -n "$Dec" -a $Dec -eq $Dec 2>/dev/null ]; then
DecAbsVal=`bc <<< "$Current-$Dec*$Max/100"`
sudo bash -c "echo $DecAbsVal >> $BrightnessFile"
exit 0
elif [ -n "$Set" -a $Set -eq $Set 2>/dev/null ]; then
SetAbsVal=`bc <<< "$Set*$Max/100"`
sudo bash -c "echo $SetAbsVal >> $BrightnessFile"
exit 0
else
usage
fi