You are not logged in.

#1 2015-11-06 19:54:04

Fuxino
Member
From: Italy
Registered: 2014-09-26
Posts: 103

Brightness keys not working

While on my old laptop screen brightness control through fn keys worked right out of the box, I'm unable to make it work with my new Asus notebook.

I can adjust brightness without any problems using xbacklight from a terminal, so I added this in dwm configuration:

#include <X11/XF86keysym.h>
...
static const char *brightup[]       = { "xbacklight", "-inc", "10", NULL};
static const char *brightdown[]     = { "xbacklight", "-dec", "10", NULL};
...
    { 0,                 XF86XK_MonBrightnessUp,    spawn,            {.v = brightup } },
    { 0,                 XF86XK_MonBrightnessDown,  spawn,            {.v = brightdown } },
...

but it doesn't work.

Using acpi_listen, pressing the brightness control keys doesn't give any output.

My video card:

$ lspci | grep -E "VGA|3D"
00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09)
04:00.0 3D controller: NVIDIA Corporation GK208M [GeForce 920M] (rev ff)

Any ideas?


Regitered Linux user #590502

"Forget Jesus. The stars died so that you could be here today." Lawrence Krauss

Offline

#2 2015-11-08 03:04:59

techwiz
Member
Registered: 2012-01-26
Posts: 48

Re: Brightness keys not working

Try this: http://askubuntu.com/questions/76081/br … dia-driver

Xorg might handle it properly once configured.

Offline

#3 2015-11-08 11:01:34

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,219
Website

Re: Brightness keys not working

Fuxino wrote:
    { 0,                 XF86XK_MonBrightnessUp,    spawn,            {.v = brightup } },
    { 0,                 XF86XK_MonBrightnessDown,  spawn,            {.v = brightdown } },

dwm doesn't recognise the multimedia key names, you have to use the raw keycodes instead.

Here are mine:

   { 0,   0x1008ff02,   spawn,   {.v = brightercmd } },
   { 0,   0x1008ff03,   spawn,   {.v = dimmercmd } },

Last edited by Head_on_a_Stick (2015-11-08 11:02:32)

Offline

#4 2015-11-08 12:08:52

Fuxino
Member
From: Italy
Registered: 2014-09-26
Posts: 103

Re: Brightness keys not working

techwiz wrote:

Try this: http://askubuntu.com/questions/76081/br … dia-driver

Xorg might handle it properly once configured.

Brightness IS working, it's just the multimedia keys to adjust it that don't. hmm

Head_on_a_Stick wrote:
Fuxino wrote:
    { 0,                 XF86XK_MonBrightnessUp,    spawn,            {.v = brightup } },
    { 0,                 XF86XK_MonBrightnessDown,  spawn,            {.v = brightdown } },

dwm doesn't recognise the multimedia key names, you have to use the raw keycodes instead.

Here are mine:

   { 0,   0x1008ff02,   spawn,   {.v = brightercmd } },
   { 0,   0x1008ff03,   spawn,   {.v = dimmercmd } },

Those values are defined in the /usr/include/X11/XF86keysym.h file which I have included, so the key names should work (and in fact they do for the volume keys).

I think the problem is that brightness keys are not recognized (for whatever reason): I tried to run showkey from the console, but when I press Fn+F5/F6 (that is, the brightness keys) nothing happens.

Anyway, as a workaround I changed my dwm config.h like this:

    { MODKEY,            XK_F5,                     spawn,            {.v = brightdown } },
    { MODKEY,            XK_F6,                     spawn,            {.v = brightup } },

and now I can adjust brightness using MODKEY+F5/F6 instead of Fn+F5/F6. smile


Regitered Linux user #590502

"Forget Jesus. The stars died so that you could be here today." Lawrence Krauss

Offline

#5 2015-11-08 12:15:07

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,219
Website

Re: Brightness keys not working

Fuxino wrote:

Those values are defined in the /usr/include/X11/XF86keysym.h file which I have included, so the key names should work (and in fact they do for the volume keys).

Yes of course, sorry -- I missed that.

Check your firmware (BIOS) menus for multimedia and function key options.

Sometimes my backlight keys are not "activated" (they are not recognized in `xev`) so I have a function in my shell configuration file:

light(){xbacklight -set $1}

Offline

#6 2015-11-08 22:49:10

Fuxino
Member
From: Italy
Registered: 2014-09-26
Posts: 103

Re: Brightness keys not working

I checked the firmware but I didn't find anything about multimedia and/or function keys. hmm I'll probably stick with the keyboard shortcut I defined, since that works fine. smile


Regitered Linux user #590502

"Forget Jesus. The stars died so that you could be here today." Lawrence Krauss

Offline

#7 2020-02-27 17:40:29

rushi_data
Member
From: New Delhi, India
Registered: 2020-02-27
Posts: 1

Re: Brightness keys not working

This is too late, but my exactly same issue was resolved when I replaced "xbacklight" by "/usr/bin/backlight" like this:

#include <X11/XF86keysym.h>
...
static const char *brightup[]       = { "/usr/bin/xbacklight", "-inc", "10", NULL };
static const char *brightdown[]     = { "/usr/bin/xbacklight", "-dec", "10", NULL };
...
    { 0,                 XF86XK_MonBrightnessUp,    spawn,            {.v = brightup } },
    { 0,                 XF86XK_MonBrightnessDown,  spawn,            {.v = brightdown } },
...

I knew my brightness keys were working by replacing the command by something simpler, which I knew was definitely working, like:

static const char *brightup[]     = { "urxvt", NULL };
static const char *brightdown[]   = { "urxvt", NULL };

which opened the terminal window, as expected.


"The struggle itself toward the heights is enough to fill a man’s heart. One must imagine Sisyphus happy."
--Albert Camus, The Myth of Sisyphus

Offline

Board footer

Powered by FluxBB