Install
Install xbindkeys:
- For ArchLinux:
pacman -S xbindkeys
; - For i3 on Ubuntu:
sudo apt install xbindkeys xbacklight
.
Usage
-
Start xbindkeys when X startup: for ArchLinux: add
xbindkeys
before "exec i3" in ~/.xinitrc; for i3 on Ubuntu: addxbindkeys
into ~/.xsessionrc; -
Get a template:
xbindkeys -d > ~/.xbindkeysrc
; -
Detect key definition:
xbindkeys -k
; -
Add output from last command to ~/.xbindkeysrc;
-
Reload new configs:
pkill xbindkeys; xbindkeys
; -
Verify the setup.
As an example, add the following lines into ~/.xbindkeysrc to increase and decrease LCD brightness of Thinkpad T440p:
"xbacklight -dec 10"
XF86MonBrightnessDown
"xbacklight -inc 10"
XF86MonBrightnessUp
Ref:
-
http://www.butlerpc.net/blog/2011/01/using-xbindkeys-on-ubuntu-linux-to-remap-key-commands/