DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Define Key Binding with xbindkeys on Linux


Install

Install xbindkeys:

  • For ArchLinux: pacman -S xbindkeys;
  • For i3 on Ubuntu: sudo apt install xbindkeys xbacklight.

Usage

  1. Start xbindkeys when X startup: for ArchLinux: add xbindkeys before "exec i3" in ~/.xinitrc; for i3 on Ubuntu: add xbindkeys into ~/.xsessionrc;

  2. Get a template: xbindkeys -d > ~/.xbindkeysrc;

  3. Detect key definition: xbindkeys -k;

  4. Add output from last command to ~/.xbindkeysrc;

  5. Reload new configs: pkill xbindkeys; xbindkeys;

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

  • Xbindkeys

  • http://www.butlerpc.net/blog/2011/01/using-xbindkeys-on-ubuntu-linux-to-remap-key-commands/



Published

Oct 16, 2014

Last Updated

Oct 16, 2014

Category

Tech

Tags

  • archlinux 20
  • key binding 1
  • ubuntu 61
  • xbindkeys 1

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor