4

After a fresh new install of Debian, I can't control my displays brightness via the "xbacklight"-tool ("No outputs have backlight property"). While this is curious enough (since their was a time it worked very well on the same machine before the OS reinstall), Im wondering how to handle the back-light control by hand.

I've found tips about managing this via files like "echo 700 | sudo tee /sys/class/backlight/intel_backlight/brightness". While this is working I'm concerned about of the two following topics.

  1. Is this secure? (Can I accidentally input a too high value and brake my hardware on this way?)
  2. Is their a more comfortable way to do that? (How can I use tools like xbacklight for that?)
4
  1. Yes, it is completely safe. Echoing into /sys (or /proc) does not overwrite kernel configuration directly, it runs a kernel userspace function which do validate the input.

    xrandr/xbacklight actually performs pretty much that (as far as I know).

  2. Since it worked before I bet that xbacklight is simply finding the wrong backlight directory in /sys/class/backlight. I suppose there is more than one directory in there, right?

    I'm not 100% sure of it but

    xrandr/xbacklight will choose the acpi directories (e.g. /sys/class/backlight/acpi_video0) before trying something like /sys/class/backlight/intel_backlight/ (which is the one your current driver is creating/using).

    (I'm not 100% sure but found a decent reference on arch wiki that more-or-less confirms it)

    To force xbacklight to use the right directory you can add the following to xorg.conf (or preferably drop a *.conf file in /etc/X11/xorg.conf.d/) with the following section:

    Section "Device"
      Identifier  "Card0"
      Driver      "intel"
      Option      "Backlight" " intel_backlight"
    EndSection
    

    (Disclaimer: I have not tested it since I do not have an intel card, if this section does not work you might try substituting "Card0" for "Screen0")

| improve this answer | |
1

The risk of you damaging your hardware by putting in too high a value is impossible since you really don't have that level of control over the system. The value you put in the /sys/class/backlight/acpi_video0/brightness file is resolved into the corresponding backlight intensity value by the firmware of your hardware and that value is what actually controls the brightness of your's screen's backlight. Also the contents of the directories /sys and /proc are generated at runtime by the kernel. To see this you can mount the filesystem of an another linux system and list the contents of the /sys and /proc. If the system is down, you will see nothing in those directories.

Also, to not cause the yourself the nuisance of writing too high a a value to the /sys/class/backlight/acpi_video0/brightness file, you can see the max possible value by reading the /sys/class/backlight/acpi_video0/max_brightness file.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.