Backlight

From Alpine Linux
Revision as of 05:55, 18 December 2024 by Prabuanand (talk | contribs) (added clarity on testing and akms support with links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Backlight control of liquid-crystal displays (LCDs) screen is covered in this page. Controlling display backlight requires either the proper udev rules, or using some form of privilege escalation.

There are multiple utilities available for this purpose.

Brightnessctl

The brightnessctl utility available in brightnessctl package is one popular and reliable alternative, although its default udev rules require too wide permissions (see #15409). You may need your own rules, or configure doas to allow running it as an unprivileged user.

Optionally enable brightnessctl service to restore brightness settings on reboot:

# rc-update add brightnessctl

To use brightnessctl to control external monitors, the ddcci-driver-linux is needed. The relevant ddcci-driver-linux-src package is available in testing repository. This driver requires Alpine Kernel Module Support akms.

Ddcutil

The ddcutil utility available in the ddcutil package can be used to control brightness in external monitors, if your hardware supports it.

Once the package is installed, check the current brightness of your monitor by issuing the command

ddcutil -d 1 getvcp 10

To set brightness of your monitor to 50% issue the command:

ddcutil -d 1 setvcp 10 50

Troubleshooting

No /dev/i2c devices exist

The command ddcutil may generate the below error:

Unexpected error. Unable to open sysfs directory /sys/class/drm/card1-HDMI-A-1/ddc/i2c-dev: No such file or directory
Unexpected error. Unable to open sysfs directory /sys/class/drm/card1-HDMI-A-2/ddc/i2c-dev: No such file or directory
No /dev/i2c devices exist.
ddcutil requires module i2c-dev.

If you receive the above error, on running ddcutil, then load the i2c-dev kernel module:

# modprobe i2c-dev

Rebooting the computer after installing ddcutil should automatically load the above module based on /usr/lib/modules-load.d/ddcutil.conf.

See Also