Other Adjusting brightness on Wayland compositors without built-in support for it

Hi! This is my first time posting on the forums, but I figured I'd want to share this because it took me way too long to figure out. I use Sway, so it doesn't have a brightness dialog you can summon by pressing a symbol like in traditional desktop environments. (But I'm pretty sure most other window managers also don't have a dialog for this.) I did some digging through the FreeBSD manual and found backlight(8), and it comes as part of the default FreeBSD user-land. Here's how you can use it to adjust your brightness.
  1. Identify your target backlight: Run ls -lA /dev/backlight to list your available backlights.
  2. Invoke backlight: Simply execute backlight -f <targetBacklight> [incr/decr] <percentage> to adjust your brightness.
It's actually much simpler than I thought it would be. I hope this finds anybody who needed this so that they don't have to spend the hour and a half trying to figure that out! 😅
 
Is backlight functionality only on laptops? I am using graphics/drm-515-kmod and desktop PC but don't have a backlight device.
I'm not sure, but I believe it's for any supported backlight. I'm using the graphics/drm-kmod binary package from the FreeBSD repository and it seems to be working fine. I am using a laptop though. I also have an Intel processor, so mine appears as just /dev/backlight/intel_backlight0.
 
Invoke backlight: Simply execute backlight -f <targetBacklight> [incr/decr] <percentage> to adjust your brightness.
I am using a laptop
You don't necessarily depend on a command line to manipulate panel brightness. See if your laptops brightness keys are supported by on of the acpi extras, hotkey, brand specific drivers. Try acpi_video(4) extension driver, in case your laptops brand is not listed or has no effect.

Code:
/boot/kernel/acpi_asus.ko
/boot/kernel/acpi_asus_wmi.ko
/boot/kernel/acpi_dock.ko
/boot/kernel/acpi_fujitsu.ko
/boot/kernel/acpi_ged.ko
/boot/kernel/acpi_hp.ko
/boot/kernel/acpi_ibm.ko
/boot/kernel/acpi_panasonic.ko
/boot/kernel/acpi_sony.ko
/boot/kernel/acpi_toshiba.ko
/boot/kernel/acpi_video.ko
/boot/kernel/acpi_wmi.ko

Some of the driver, acpi_video(4) in particular, should be loaded after the drm kernel module is loaded (i.e. /etc/rc.conf: kld_list="i915kms acpi_video").

On my ThinkPad, the acpi_ibm(4) driver enables Fn + increase/decrease backlight brightness keys (in console and x11/wayland), provided the drm-kmod driver (amdgpu) is loaded.

If none of the drivers give brightness key support, one can always configure a DE, WM backlight(8) keyboard shortcut combination.
 
You don't necessarily depend on a command line to manipulate panel brightness. See if your laptops brightness keys are supported by on of the acpi extras, hotkey, brand specific drivers. Try acpi_video(4) extension driver, in case your laptops brand is not listed or has no effect.

Code:
/boot/kernel/acpi_asus.ko
/boot/kernel/acpi_asus_wmi.ko
/boot/kernel/acpi_dock.ko
/boot/kernel/acpi_fujitsu.ko
/boot/kernel/acpi_ged.ko
/boot/kernel/acpi_hp.ko
/boot/kernel/acpi_ibm.ko
/boot/kernel/acpi_panasonic.ko
/boot/kernel/acpi_sony.ko
/boot/kernel/acpi_toshiba.ko
/boot/kernel/acpi_video.ko
/boot/kernel/acpi_wmi.ko

Some of the driver, acpi_video(4) in particular, should be loaded after the drm kernel module is loaded (i.e. /etc/rc.conf: kld_list="i915kms acpi_video").

On my TinkPad, the acpi_ibm(4) driver enables Fn + increase/decrease backlight brightness keys, provided the drm-kmod driver (amdgpu) is loaded.

If none of the drivers give brightness key support, one can always configure a DE, WM backlight(8) keyboard shortcut combination.

Thanks! I forgot about that. I remember reading about acpi_video(4) while finding backlight(8), but mine worked without it so it either auto-loaded the correct kernel module or Just Works™ without it somehow, so I forgot to mention that in my original post. I did also check that my brightness keys don't work, they don't.
 
Back
Top