You are not logged in.

#1 2016-01-12 15:54:10

vlast777
Member
Registered: 2015-02-10
Posts: 57

MacBook Pro: Media Keys i3wm

Hey there,

I recently installed Arch Linux on my MacBook Pro Mid 2009. Iam using i3wm as my Windows Manager.
Now most things seem to work fine, but I can't get my media keys (the screen brightness especially) to work.

I got xbacklight installed, now I figured out the Keys by using

xev

which returns
For the "Screenbrightness Down Key":

KeyRelease event, serial 32, synthetic NO, window 0x1000001,
    root 0x4a5, subw 0x0, time 393914, (-218,380), 
root:(640,400),
    state 0x0, keycode 232 (keysym [b]0x1008ff03[/b], 
XF86MonBrightnessDown), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

and for the "Screenbrightness Up Key":

KeyPress event, serial 32, synthetic NO, window 0x1000001,
    root 0x4a5, subw 0x0, time 396154, (-218,380), 
root:(640,400),
    state 0x0, keycode 233 (keysym [b]0x1008ff02[/b], 
XF86MonBrightnessUp), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

now I edited my

~/.config/i3/config

by adding the following lines:

bindsym XF86MonBrightnessUp exec xbacklight -inc 20
bindsym XF86MonBrightnessDown exec xbacklight -dec 20

and rebooted my Machine.
Now after rebooting, I tried pressing the Screenbrightness Up / Down Keys on my keyboard, but nothing happend.
So I fired up xev again, just to find a totally different output for them both nw:

The Screenbrightness Down Key:

FocusOut event, serial 29, synthetic NO, window 0x1000001,
    mode NotifyGrab, detail NotifyAncestor

FocusOut event, serial 29, synthetic NO, window 0x1000001,
    mode NotifyUngrab, detail NotifyPointer

FocusIn event, serial 29, synthetic NO, window 0x1000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 29, synthetic NO, window 0x0,
    keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   

The Screenbrightness Up Key:

FocusOut event, serial 32, synthetic NO, window 0x1000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 32, synthetic NO, window 0x1000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 32, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0  

Does anyone have any idea, why this happens?
If I remove the lines mentioned above from my ~/.config/i3/config file, everything is normal again, just the buttons don't work either.

On MATE and Xfce both (keyboard backlight and screen backlight) work out of the box.

edit: I also tried entering the marked in bold numbers, in the above code snippets in my ~/.config/i3/config instead of the key names, but it was the exact same result.

Thanks in advance.

Last edited by vlast777 (2016-01-12 15:56:05)

Offline

#2 2016-01-12 16:37:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: MacBook Pro: Media Keys i3wm

Does the "exec xbacklight -inc 20" or the decrease command do what you'd expect when run from a terminal?  Can you bind those keys to more mundane actions (like launching a terminal) to see if they work?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#3 2016-01-12 17:17:02

vlast777
Member
Registered: 2015-02-10
Posts: 57

Re: MacBook Pro: Media Keys i3wm

$ xbacklight -dec 20

results in:

No outputs have backlight property

while starting a Terminal with the exact same key works perfectly fine.
Seems like the MacBook Screenbrightness is not handled by xbacklight, or am I mistaken?

Last edited by vlast777 (2016-01-12 17:21:10)

Offline

#4 2016-01-12 17:44:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: MacBook Pro: Media Keys i3wm

I don't know anything about macs and/or backlights, but the command is failing - so that's the problem.  This has nothing to do with binding media keys: that works.  You just need to find a command to bind them to that does what you want.

This might be relevant: https://bbs.archlinux.org/viewtopic.php?id=207394


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

Board footer

Powered by FluxBB