I realize there are potential duplicates of my question. However, I have scoured different pages and nothing solved my problem. I have recently done a fresh install of Ubuntu 18.04 (had the previous long-term release) and simply cannot get the brightness keys to trigger brightness changes.
Details:
- Ubuntu x64 18.04.
- Not using Wayland.
- No integrated graphics in the processor.
- There is no screen brightness slider when I click on the battery icon. I had a brightness controller showing on the previous Ubuntu installation on this exact same hardware - why was it hidden in this iteration of Ubuntu?
- NVIDIA proprietary drivers in use as per the following image:
CPU:
*-cpu
description: CPU
product: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
bus info: cpu@0
version: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp cpufreq
GPU:
sudo lshw -C display
*-display
description: VGA compatible controller
product: GP106M [GeForce GTX 1060 Mobile]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:122 memory:dd000000-ddffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:e000(size=128) memory:c0000-dffff
This is my current grub configuration:
GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
With these settings on (I did restart grub and the system after setting them), I can listen for the Fn+Brightness combinations:
acpi_listen
video/brightnessdown BRTDN 00000087 00000000
video/brightnessup BRTUP 00000086 00000000
With this, I at least know that pressing the brightness change keys (via Fn plus F8 for lower brightness or F9 for higher) is recognized by the system. If I'm not mistaken, these events are supposed to trigger certain brightness change scripts.
However, it seems nothing is called, even though those events are assigned.
Brightness down: video/brightnessdown BRTDN 00000087 00000000
cat /etc/acpi/events/asus-keyboard-backlight-down
# /etc/acpi/events/asus-keyboard-backlight-down
# This is called when the user presses the key brightness
# down button and calls /etc/acpi/asus-keyboard-backlight.sh for
# further processing.
event=video/brightnessdown BRTDN 00000087 00000000
action=/etc/acpi/asus-keyboard-backlight.sh down
Brightness up: video/brightnessup BRTUP 00000086 00000000
cat /etc/acpi/events/asus-keyboard-backlight-up
# /etc/acpi/events/asus-keyboard-backlight-up
# This is called when the user presses the key brightness
# up button and calls /etc/acpi/asus-keyboard-backlight.sh for
# further processing.
event=video/brightnessup BRTUP 00000086 00000000
action=/etc/acpi/asus-keyboard-backlight.sh up
Both events define as action the following file:
vim /etc/acpi/asus-keyboard-backlight.sh
This is its content:
KEYS_DIR=/sys/class/leds/phy0-led\:\:kbd_backlight
test -d $KEYS_DIR || exit 0
MIN=0
MAX=$(cat $KEYS_DIR/max_brightness)
VAL=$(cat $KEYS_DIR/brightness)
if [ "$1" = down ]; then
VAL=$((VAL-1))
else
VAL=$((VAL+1))
fi
if [ "$VAL" -lt $MIN ]; then
VAL=$MIN
elif [ "$VAL" -gt $MAX ]; then
VAL=$MAX
fi
echo $VAL > $KEYS_DIR/brightness
Furthermore, if I inspect the directory in variable $KEYS_DIR, there are the following contents:
sudo ls /sys/class/leds/phy0-led
brightness device max_brightness power subsystem trigger uevent
The brightness and max_brightness files are empty.
Everything appears to be correctly setup, but I can't understand why doesn't the brightness change, why doesn't it remain saved after reboot if I use an alternative program such as brightness-controller or xbacklight and why is the brightness slider missing?
Thank you very much.