1

There are multimedia buttons in my keyboard, the key I am actually interested in are Brightness keys (XF86MonBrightness{UP|DOWN}). I am using bspwm window manager, and without any sxhkdrc config the brightness is automatically handled, I want to disable default behavior of the key, and set up my own.

The brightness keys are working even without any desktop environment or window manager (I mean they are working in tty consoles)

Also: Why my key generate XF86MonBrightness{Up|Down} and not XF86KbdBrightness{Up|Down}

Afroz Alam
  • 21
  • 2
  • As the names sugest: XF86KbdBrightness is for adjusting keyboard backlight brightness XF86MonBrightness is for monitor background brightness They are probably controlled by your bios, so you first have to find a way to disable it on that level before you can use the keys for something else on ui level. – switch87 Nov 23 '21 at 08:52
  • @switch87 Oh! I see, Keyboard and the Monitor brightness. But I don't think that it is controlled by the bios, as I have a problem related to it. (Changing the brightness hangs up the linux kernel, that happens only in linux, windows 10 is free of this issue) – Afroz Alam Nov 23 '21 at 09:27
  • There are many possible ways to implement the brightness adjustment. The system firmware might set up ACPI or WMI events for those keys, or some vendor-specific setup. Is there anything in your `/sys/class/backlight/` directory? (or does that directory even exist?) Have you read [the relevant Arch Wiki page](https://wiki.archlinux.org/title/backlight)? – telcoM Nov 23 '21 at 12:52
  • @telcoM Yes, it has 2 `acpi_video0` and `intel_backlight`, I use `acpi_video0` to control my brightness, but, don't know what `intel_backlight` does. – Afroz Alam Nov 23 '21 at 17:16

1 Answers1

0

In the comments you said your /sys/class/backlight/ directory contains both acpi_video0 and intel_backlight.

That indicates you might potentially have two overlapping mechanisms for adjusting the backlight brightness, and that could well be the reason of the kernel hangs you said you're experiencing.

There is a kernel boot option you can use to modify the backlight control functionality: acpi_backlight=. It can take four possible values: video, vendor, native and none.

In kernel source code, in file drivers/acpi/video_detect.c, you will find a long list of system models for which this option is automatically set to some value, as the kernel developers have already been told that those models need it set a particular way.

For example, if the entry for a particular model says .callback = video_detect_force_vendor it causes the boot option acpi_backlight=vendor to be automatically applied unless you explicitly specify otherwise. Since you did not tell your system model, you might want to browse through this list and see if it gives you any clues: for example, if your system is from the same model series as a model that is already listed, you might try the same option that is automatically applied to that already-listed model.

Note that the list also includes some desktops that are known to falsely report a laptop-like backlight control.

Alternatively, you could try each acpi_backlight= boot option value in turn, and see if any one of them works for you. If you find a value that makes your kernel hang-up problems go away, you might want to send an email to the Linux ACPI subsystem maintainers, with the dmidecode output from your system and identifying the option that works.

Or if you have even beginner-level C programming skills and are willing to build a custom kernel, you might even write and test a patch yourself that will apply the necessary option automatically, by just adding your system's information to the appropriate list. The Linux ACPI subsystem maintainers would appreciate such a patch. (This would be an ideal "beginner's first kernel patch"!)

telcoM
  • 87,318
  • 3
  • 112
  • 232
  • `acpi_backlight=none`, `acpi_backlight=native`, `acpi_backlight=vendor` they all just disables the brightness control for me, `acpi_backlight=video` works (but freezes the system) and somehow after setting these settings and coming back on default, the `acpi_video0` is gone, surprisingly – Afroz Alam Nov 24 '21 at 12:35
  • I am using `Dell Inspiron 14` n4030 (model no.). It's very old. – Afroz Alam Nov 24 '21 at 12:39