sudo pacman -Sy xorg-input
xinput list
xinput disable <ID>
- find the keyboard in the list and take the id
- disable that id, so key presses are no longer working (will still work with actkbd)
cat /proc/bus/input/devices
- find the keyboard and take the
eventXX
fromHandlers
trizen -Sy actkbd
actkbd -h
actkbd -x -s -d /dev/input/eventXX
- install actkbd from AUR and check the options
-s
shows the typed key code-x
shows the executed command (there are none yet)
Example:
79:::xdotool key super+Left
80:::xdotool key super+Down
81:::xdotool key super+Right
75:::xdotool key super+1
76:::xdotool key super+Up
77:::xdotool key super+2
71:::xdotool key super+3
72:::xdotool key super+4
73:::xdotool key super+5
82:::xdotool key Escape
83:::i3-msg exec i3-sensible-terminal
78:::i3-msg mode "move to workspace"
96:::i3-msg mode "move"
69:::i3-msg split v
98:::i3-msg split h
55:::i3-msg fullscreen
74:::i3-msg kill
- key codes (e.g.
79
is the 1 on my numpad) mapped to shell commands xdotool key
presses the specified key or key combo
Start script /opt/start_actkbd
:
#!/bin/bash
export DISPLAY=:0
export XAUTHORITY=/home/j/.Xauthority
event=`cat /proc/bus/input/devices | grep 046a -A 5 | grep -o -P 'event\d+'`
sleep 1
id=`/usr/bin/xinput list | grep 046a:0011 | grep -o -P 'id=\d+' | sed s/id=//`
/usr/bin/xinput disable $id
/usr/bin/actkbd -x -s -d /dev/input/$event
j
is the user running xserver (adapt to your situation)046a
is the vendor code from Cherry (adapt to your situation)chmod +x /opt/start_actkbd
- test it, next Systemd service
Systemd service unit /etc/systemd/system/macropad.service
:
[Unit]
Description=Start actkbd when macropad connected
[Service]
ExecStart=/opt/start_actkbd
- test it:
systemctl start macropad.service
andsystemctl status macropad.service
- next run the service when keyboard is plugged in
udev rule /etc/udev/rules.d/72-macropad.rules
:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046a", ATTRS{idProduct}=="0011", OWNER="j", TAG+="systemd", ENV{SYSTEMD_WANTS}="macropad.service"
- again adapt to your user and keyboard