Add udev rule: swap caps_lock with escape on usb keyboards

This commit is contained in:
Riyyi
2020-02-13 04:30:34 +01:00
parent 415c022365
commit d544dfe9c3
2 changed files with 17 additions and 0 deletions
+4
View File
@@ -40,6 +40,10 @@ EOF
# If no option is provided
[ "$#" -eq 0 ] && help && exit
# Set required X variables
export DISPLAY=:0
export XAUTHORITY="$XDG_DATA_HOME/xorg/Xauthority"
SCRIPT="$(basename "$0")"
# Option handling
while getopts ':h?d:k:s:' opt; do
+13
View File
@@ -0,0 +1,13 @@
# -*- mode: conf -*-
# When usb keyboard is plugged in, run inputctl script
# Requires: run as local user with X variables set (DISPLAY and XAUTHORITY)
SUBSYSTEM=="usb",
ACTION=="add",
ATTRS{idVendor}=="04d9",
ATTRS{idProduct}=="0169",
OWNER="rick",
RUN+="/home/rick/.scripts/inputctl.sh -k on"
# https://wiki.archlinux.org/index.php/Udev#Execute_on_VGA_cable_plug_in