add interception tools and caps2esc

Existing users who use xmodmap to rebind caps lock as control in X will
probably want to disable xmodmap first.
This commit is contained in:
Pig Monkey 2020-12-30 18:54:56 -08:00
parent 0be4efe09a
commit 461d842645
5 changed files with 36 additions and 0 deletions

View file

@ -10,6 +10,12 @@ user:
hostname: nous
interception:
caps2esc:
enabled: True
mode: 1
delay: 20000
dotfiles:
url: git@github.com:pigmonkey/dotfiles.git
destination: projects/dotfiles

View file

@ -11,6 +11,7 @@
- { role: ssh, tags: ['ssh'] }
- { role: dotfiles, tags: ['dotfiles'] }
- { role: ssd, tags: ['ssd'] }
- { role: interception, tags: ['interception'] }
- { role: fonts, tags: ['fonts'] }
- { role: x, tags: ['x'] }
- { role: lightdm, tags: ['lightdm'], when: "display_manager == 'lightdm'" }

View file

@ -0,0 +1,5 @@
---
- name: restart udevmon
service:
name: udevmon.service
state: restarted

View file

@ -0,0 +1,20 @@
---
- name: Install caps2esc
pacman:
name: interception-caps2esc
state: present
- name: Push caps2esc udevmon config
template:
src: caps2esc.yaml.j2
dest: /etc/interception/udevmon.d/caps2esc.yaml
notify:
- restart udevmon
when: interception.caps2esc.enabled is defined and interception.caps2esc.enabled == True
- name: Enable and start udevmon
service:
name: udevmon.service
enabled: yes
state: started
when: interception.caps2esc.enabled is defined and interception.caps2esc.enabled == True

View file

@ -0,0 +1,4 @@
- JOB: "intercept -g $DEVNODE | caps2esc -m {{ interception.caps2esc.mode }} -t {{ interception.caps2esc.delay }} | uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]