Enabling multimedia keys
Hi,
How can I make multimedia keys work in i3?
Is it possible to create a user-contributed article for this? I think it would be helpful for beginners :)
Hi,
How can I make multimedia keys work in i3?
Is it possible to create a user-contributed article for this? I think it would be helpful for beginners :)
In your ~/i3/config add the following keybindings:
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness
# Touchpad controls
bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
# Media player controls
bindsym XF86AudioPlay exec playerctl play
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
The script toggletouchpad.sh for toggling your touchpad should have following content:
#!/bin/bash
if synclient -l | grep "TouchpadOff .*=.*0" ; then
synclient TouchpadOff=1 ;
else
synclient TouchpadOff=0 ;
fi
Playerctl is a command-line utility for controlling media players over DBus that works with most players.
If the XF86* keysyms do not work for you, you can see the available keysyms for your computer by executing this command:
xmodmap -pke
Or xev
, an interactive tool for finding key symbols:
xev
(thanks to tieni for this answer)
To me volumes worked only like this: # Pulse Audio controls bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5% #increase sound volume bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% #decrease sound volume
Or # Pulse Audio controls bindsym XF86AudioRaiseVolume exec pactl -- set-sink-volume 0 +5% #increase sound volume bindsym XF86AudioLowerVolume exec pactl -- set-sink-volume 0 -5% #decrease sound volume
answered 2015-12-04 15:09:45 +0000
This post is a wiki. Anyone with karma >100 is welcome to improve it.
In my case I have to use
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 1 +5% #increase sound volume
where the sink-volume value is changed to 1. To find the right value one can use
pactl list sinks
Asked: 2014-04-29 23:20:48 +0000
Seen: 19,330 times
Last updated: Sep 16
I agree, that this would help new users. That is probably why the [User's Guide](http://i3wm.org/docs/userguide.html) already covers this in the section [4.3 Keyboard Bindings](http://i3wm.org/docs/userguide.html#keybindings). :)