After installing Arch Linux with suckless dwm window manager, some of the keys in your keyboard may stop working.
This requires the need to manually set up keybinds for your set up.
Required Installations
In order to get started, there are some packages that you need to install to set the keybinds.
The packages are xbindkeys
and xbindkeys_config
The commands to install these two packages for Arch are:
if you don't have yay installed, run this first
sudo pacman -Sy yay
or you can also build them from AUR, but I suggest using yay
yay -S xbindkeys xbindkeys_config-gtk2
xbindkeys -d > ~/.xbindkeysrc
This will create a file called .xbindkeysrc in your home directory which contains all your keybinds, but we will be using the GUI version instead.
If you want to not use the GUI version or if it is not working for you, check out the xbindkeys manual here
Setting Keybinds
- Open the application called
xbindkeys_config
either from dmenu or from the terminal - You will be prompted with a window such as:
- On the bottom bar, there are several options, select
New
which will open a panel to the left. - There are several text boxes for each attribute. Name would contain the name of the keybind, Key will contain the keycode of the hardware keys and Action contains the command that will execute upon pressing the button.
Configs for Keybinds
Config for Volume Up:
- First write Volume Up in the name and then select
Get Key
that will pop up a blank window. - Select the key combination for your keybind
- Next, put this command into the Action box
pactl set-sink-volume @DEFAULT_SINK@ +1%
You can change 1% to whatever value you want to increment the volume by.
- Lastly hit Save
Config for Volume Down:
- Same as Volume up except the Action command will be
pactl set-sink-volume @DEFAULT_SINK@ -1%
Config for Mute:
- To mute/unmute the Audio Output/Speaker/Headphone
pactl set-sink-mute @DEFAULT_SINK@ toggle
- To mute/unmute the Audio Input/Microphone
pactl set-source-mute @DEFAULT_SOURCE@ toggle
Config for Media Playback:
To set keybinds for pause/play or next/previous, you need to install playerctl
Run the command yay -Sy playerctl
in the terminal and you are good to go.
The Action Commands for Pause/Play:
playerctl play-pause
The Action Commands for Previous Track:
playerctl previous
The Action Commands for Next Track:
playerctl next
Once Done, Hit Save and Exit and lastly, in order for your keybinds to remain permanent after each boot, you must configure your .xinitrc in the directory ~.xinitrc
Use a text editor of your choice and add the following line:
xbindkeys &
before exec dwm
Top comments (0)