The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.
Ask Your Question
4

Enabling multimedia keys

asked 2014-04-29 23:20:48 +0000

tieni gravatar image

updated 2014-05-03 19:22:49 +0000

TonyC gravatar image

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 :)

edit retag flag offensive close merge delete

Comments

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). :)

Adaephon gravatar imageAdaephon ( 2014-04-30 08:52:45 +0000 )edit

2 answers

Sort by ยป oldest newest most voted
7

answered 2014-05-03 19:24:00 +0000

TonyC gravatar image

updated 2015-09-16 07:26:20 +0000

Michael gravatar image

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)

edit flag offensive delete link more

Comments

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

Fabio Falci gravatar imageFabio Falci ( 2015-03-31 13:54:52 +0000 )edit

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

Fabio Falci gravatar imageFabio Falci ( 2015-03-31 13:58:16 +0000 )edit

Is there alternative to playerctl? My distro doesn't provide playerctl in its packages

Miro gravatar imageMiro ( 2015-10-17 06:32:33 +0000 )edit

Miro, just intall from Github then: https://github.com/acrisci/playerctl . If your key board has only one key to play and pause, playerctl has an option to toggle between play and pause.Use something like this: bindsym XF86AudioPlay exec playerctl play-pause

hmln gravatar imagehmln ( 2015-10-24 08:59:55 +0000 )edit

Any idea how to limit maximum volume that it could ever go to to say 100%? I have a das keyboard with a volume wheel and right now if i keep turning it clockwise it can easily boost the volume beyond 300% and introduce distortions.

fmasi gravatar imagefmasi ( 2015-11-10 20:28:14 +0000 )edit
0

answered 2015-12-04 15:09:45 +0000

this post is marked as community wiki

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
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-04-29 23:20:48 +0000

Seen: 19,330 times

Last updated: Sep 16