I am switching back from mac-land, and the thing that bugs me the most about linux these days is the keybindings. Specifically, right now, I miss Karabiner, and the ability to turn the caps lock both into control and escape at the sametime.

Luckily, I found caps2esc. Unluckily, I don't quite understand how to install it.

I found the way to compile and make install both interception tools and caps2esc. But now it seems I need to mess around with systemd? Now I'm lost.


Here's the relevant documentation:

  1. https://gitlab.com/interception/linux/plugins/caps2esc

  2. https://gitlab.com/interception/linux/tools/blob/master/README.md

  • 1
    to really help I'd have to run it, and sorry i'm not doing that. a quick scan-read of files however and I don't see the need of sysd except if you want it to auto-run every boot or use system (systemctl) commands to stop/restart/start/.. it (which would be nicer yes) but are not necessary from my read.
    – guiverc
    Commented Nov 23, 2017 at 6:09

3 Answers 3


I think I mostly figured this out.

  1. Follow the instructions to cmake, make, sudo make install

  2. On Ubuntu/Debian, these executables are now in /usr/local/bin/caps2esc

  3. sudoedit /etc/udevmon.yaml and then put this in:

     - JOB: "intercept -g $DEVNODE | caps2esc | uinput -d $DEVNODE"
  4. sudoedit /etc/systemd/system/udevmon.service and put this in:

     ExecStart=/usr/bin/nice -n -20 /usr/local/bin/udevmon -c /etc/udevmon.yaml
  5. sudo systemctl enable --now udevmon

  • 4
    When I ran sudo make install on interception tools, it installed udevmon to /usr/local/bin/udevmon. I changed the reference in /etc/systemd/system/udevmon.service from /usr/bin/udevmon to /usr/local/bin/udevmon and all was well.
    – Duane J
    Commented Jul 14, 2019 at 22:51
  • 1
    Also note that if you don't already have it ( didn't on Pop!_OS), you'll need to install Interception Tools: gitlab.com/interception/linux/tools. The cmake .., make, sudo make install instructions worked out for that for me as well.
    – Tom
    Commented Jan 1, 2020 at 19:14
  • 1
    update to add: I also had to install libyaml-cpp-dev and libevdev to install interception tools.
    – Tom
    Commented Jan 1, 2020 at 19:22
  • I've also had to install libevdev-dev, otherwise I was getting a interception_tools/uinput.cpp:14:38: fatal error: libevdev/libevdev-uinput.h: No such file or directory. Commented Aug 27, 2020 at 16:54
  • 1
    To recap from the message and comments (any my own experience): 1. sudo apt install libyaml-cpp-dev libevdev-dev libudev-dev. 2. Compile and interception-tools following @Tom comment. 3. Install caps2esc (mkdir build, cd build, cmake .. , make, sudo make install). 4. Create the files /etc/udevmon.yaml and /etc/systemd/system/udevmon.service as explained above BUT use the path /usr/local/bin/udevmon instead of /usr/bin/udevmon. 5. sudo systemctl enable --now udevmon.
    – juanjux
    Commented Oct 28, 2020 at 10:17

I've lightly adapted a guide to installing the sister application dual-function-keys on this page. I managed to follow the steps in the OP's answer and the comments with some trial and erorr, but this guide puts it all together in order.

# install build deps
$ sudo apt install libudev-dev libyaml-cpp-dev libevdev-dev cmake
# create a folder where to clone the source code
$ mkdir src && cd src
# clone the necessary code
$ git clone https://gitlab.com/interception/linux/tools
$ git clone https://gitlab.com/interception/linux/plugins/caps2esc
# build and install the interception framework
$ cd tools
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
$ cd ../..
# build the caps2esc plugin
$ cd caps2esc
$ make && sudo make install

After the installation make and edit the two configuration files as in the OP's answer, changing the path to the install location if necessary.


After spending too much time on udevmon configuration in ubuntu 22.04, here's my gotcha.

First you need to install interception-tools and interception-caps2esc packages:

sudo apt install interception-tools interception-caps2esc 

Config file is located at /etc/interception/udevmon.yaml. If you check package info apt show interception-tools, you'll see that:

The upstream command name 'intercept' is renamed to 'interception' in this package to avoid the name collision. If you wish to use command names which the upstream uses, please install the interception-tools-compat package.

So to make it work, you need to create /etc/interception/udevmon.yaml and change intercept to interception:

- JOB: "intercept -g $DEVNODE | caps2esc | uinput -d $DEVNODE"

Then restart service with systemctl restart udevmon and you're good to go.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .