1
I've installed the i3 window manager alongside GNOME desktop on Ubuntu-GNOME 16.04. I'm having trouble getting my media keys working with a Logitech G610 keyboard.
I have the following in my ~/.config/i3/config
file:
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
and have confirmed that those commands work in the terminal. The issue I'm seeing is that the XF86AudioRaiseVolume
etc keypress events are not registering.
If I use xev -event keyboard
to try see the keycodes, when I press the multimedia keys all I get is the following:
MappingNotify event, serial 30, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeymapNotify event, serial 31, 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
and no keycode is reported like for other keys. However, using sudo showkey -k
, I get the following which are the expected values:
keycode 113 press
keycode 113 release
keycode 115 press
keycode 115 release
keycode 114 press
keycode 114 release
Running xinput
, I see the following
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech MX Master id=12 [slave pointer (2)]
⎜ ↳ AlpsPS/2 ALPS DualPoint TouchPad id=15 [slave pointer (2)]
⎜ ↳ AlpsPS/2 ALPS DualPoint Stick id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ Logitech Gaming Keyboard G610 id=10 [slave keyboard (3)]
↳ Logitech Gaming Keyboard G610 id=11 [slave keyboard (3)]
↳ Dell WMI hotkeys id=13 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=14 [slave keyboard (3)]
↳ DELL Wireless hotkeys id=17 [slave keyboard (3)]
where the Logitech keyboard shows up as two devices. Running xinput list-props 10
and xinput list-props 11
I see that the first listing maps to /dev/input/event8
, while the second maps to /dev/input/event9
.
If I run xinput test 10
I see that the first listing for my keyboard responds to all the normal keyboard keys but not the media keys, while xinput test 11
responds only to the media keys:
key press 121
key release 121
key press 123
key release 123
key press 122
key release 122
(These are off by 8 from the showkey
output, but apparently that's expected. Also, these values match the mapping output by xmodmap -pke
, i.e. keycode 121 = XF86AudioMute NoSymbol XF86AudioMute
). Running sudo evtest /dev/input/event8
and sudo evtest /dev/input/event9
produce similar results.
So, my understanding of the process between keypress and handling is pretty fuzzy, but it seems that maybe the fact that the normal keys and media keys are on different input devices is preventing the media keypress events from getting through to the X session (as evidenced by not showing up for xev
?) and therefore not getting through to i3? This works fine for the GNOME desktop, so is there something I need to configure to get them working for i3? I'm at a loss for how to proceed from here, any help would be greatly appreciated.
EDIT
I originally had quotes around the commands in my ~/.config/i3/config
file, but that doesn't work. I've edited above to make it correct, but that wasn't the root of the problem.
Update: Starting i3 with just
exec i3
in my~/.xinitrc
file was causing some issues with dbus that caused things like my terminal taking 6 seconds to open. For anyone who might be following this method, changing the contents of~/.xinitrc
toexec dbus-launch --exit-with-session i3
seems to have fixed that – dpkoch – 2018-10-05T17:19:09.670