I've moved from Gnome to i3 on Manjaro, and I'm almost done with configuring the window manager, and terminal colors and whatnot. After some time I just decided to listen to some music, and after a couple of minutes I realized that the volume keys and playback keys don't work.
I have a Razer Blackwidow Stealth 2014 keyboard, so those media keys are actually together with the Function keys. For example: Play/Pause is on F6, and it acts as a media key when I press the Fn key, like in Fn + F6.
Best Answer
The search for the answer
After some time messing around with the controls, I've found a post on the old i3 FAQ board: https://faq.i3wm.org/question/3747/enabling-multimedia-keys.1.html
It says to paste the following into i3's .config file (bellow is a lightly modified version, with some lines removed, which are not relevant to this particular question):
And it didn't work either, however the process of finding the answer is correct.
The real answer
To me, at least, the problem was that after copying those lines, the keys would not work. After some more research, I found out that the volume commands could be a little different, using
amixer
instead of PulseAudio'spactl
.At the end, those were left like this:
and they started working.
The playback keys were a little more trickier. I deduced that the .config tells which command is executed to do the action. Then I proceeded to try
playerctl play-pause
on my terminal. Of course it didn't work, because playerctl was not installed. After installing it (usingsudo pacman -S playerctl
) those keyboard commands worked just fine too.