OS : Ubuntu – 18.04 LTS
I have 2 symbolic links in /sys/class/backlight/
directory.
acpi_video0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0/
nv_backlight -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-LVDS-1/nv_backlight/
The brightness hotkeys change the value of acpi_video0/brightness
. But that doesn't actually change the display's brightness.
But, manually changing the value ofnv_backlight/brightness
actually change the display's brightness.
So, linking the hotkeys to nv_backlight
instead of acpi_video0
will solve my problem, but I don't know how to do it.
Edit: The pop-up slider progress bar appears on the screen on the operation of the Fn keys for brightness(hotkeys).
Edit:
-
Input:
cat /sys/class/backlight/nv_backlight/max_brightness
Output:
100
-
Input:
cat /sys/class/backlight/nv_backlight/actual_brightness
Output(this value changes automatically to the same value, I manually gave into
/sys/class/backlight/nv_backlight/brightness
):10
-
Input:
cat /sys/class/backlight/acpi_video0/max_brightness
Output:
15
Best Answer
Bash script
redirect-brightness
Your problem is function keys to increase/decrease brightness are updating
/sys/class/backlight/acpi_video0/brightness
instead of/sys/class/backlight/nv_backlight/brightness
The original request was to intercept the function keys and use them to control the
nv_backlight
driver. The problem with this is:udev
scriptsThe solution is to use
inotify
to monitor changes toacpi_video0
. Then calculate the brightness percentage and apply that same percentage tonv_backlight
.In the bash script below you need to set:
Place the script in
/usr/local/bin
and make it executable using:First run the script from the command line using
If there is a problem check the log file using:
If all works well add
redirect-brightness
to your startup applications.redirect-brightness
bash scriptOriginal Answer June 11, 2018.
Work In Progress Answer
There are many nVidia users with similar problems in Ubuntu 18.04:
Before writing a script
I can write a script to mimic changes to /acpi_video and populate /nv_backlight but before I do try this:
/etc/default/grub
.quiet splash
acpi_backlight=vendor
sudo update-grub
According to this answer it should work for you: Xubuntu 18.04: make Fn brightness keys work with /sys/class/backlight/nv_backlight/
Wayland
Brightness doesn't work under Wayland. Make sure you aren't using it. See: The brightness of laptop screen cannot be adjusted with either the buttons or the slider. Edit