Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Backlight

Krzysztof Zych edited this page Nov 22, 2015 · 1 revision

Issues with setting backlight

There are many possible causes to backlight setting in Foggy not working. This page addresses a few, with ideas on how to diagnose them.

Note: all mentions of package names are as on Debian/Ubuntu/Mint. For other Linux distros they're usually similar.

Keys not working

This is usually an ACPI issue.

First off, verify that Linux correctly recognizes your machine's ACPI events as keys.

  1. check that you already have, or install the xinput package
  2. in a terminal, run xinput and see if a device such as "Asus WMI hotkeys" is listed. This will of course differ based on your machine's brand, but should be easy to spot
  3. note the id listed in the second column
  4. (in a terminal) run xinput --test ID, substituting that id in
  5. press your key combinations. each one should result in printing a keypress and keyrelease, with different codes. To end this test, press Ctrl+C. Warning: the keys may still do their assigned functions, such as suspend your machine or disable WiFi, your touchpad or display. Take note.

Now, the most common issue is the brightness keys not working, and others mostly functional. To resolve this, search for "acpi_osi" and try the various solutions listed. These will usually tell you to update /etc/default/grub and add acpi_osi=SOMETHING to your boot cmdline, then run update-grub and restart your machine. Run xinput --test again, and see if pressing the keys produces output.

If they don't, you are stuck with re-binding the keys, see below. If they do work, but are not recognized with the default keybinding, check if Xorg recognizes them as XF86MonBrightnessUp and XF86MonBrightnessDown:

  1. check that you already have, or install the x11-utils package
  2. in a terminal, run xev. move the mouse cursor inside its window; note that it produces plenty of output describing your cursor movements
  3. try pressing your backlight keys. Same warning as in 5 above applies. Look for KeyPress and KeyRelease events, and the key names listed. If your brightness keys produce different key names, use these. If they only produce keycodes and not names, you may be able to fix that issue by using setxkbmap or xmodmap; this is however outside of the scope of this guide.

inc_backlight not working

This function uses XRandR brightness controls. Whether these are correct depends on ACPI settings (as above), your graphics card model and driver. For the intel driver at least, you may influence which backlight device is used by creating an xorg.conf file, adding a section for your graphics card and setting the Backlight option there. Run man intel for details. There may be similar options for the other graphics drivers.

If that doesn't help, you may be able to solve it by adding a udev rule to allow members of some group (usually video) to alter backlight settings, and write your own function to do that.

Using other keys

Say for example, that your laptop has brightness symbols on F5 and F6 for down and up respectively. In this case, your keybindings are:

awful.key({ modkey }, "F5", function() foggy.shortcuts.inc_backlight(-10) end),
awful.key({ modkey }, "F6", function() foggy.shortcuts.inc_backlight(10) end),
Clone this wiki locally