From e1ce0b30cefac94926a7787c7584ab8ca96e73a9 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 29 Mar 2021 20:22:41 +0200 Subject: [PATCH] Improve capslock escape swapping method --- .config/xorg/xinitrc | 4 ---- etc/X11/xorg.conf.d/00-keyboard.conf | 7 +++++++ etc/systemd/logind.conf | 15 ++++++++------- etc/udev/rules.d/00-usb-keyboard.rules | 13 ------------- 4 files changed, 15 insertions(+), 24 deletions(-) create mode 100644 etc/X11/xorg.conf.d/00-keyboard.conf delete mode 100644 etc/udev/rules.d/00-usb-keyboard.rules diff --git a/.config/xorg/xinitrc b/.config/xorg/xinitrc index 47dc5d9..da3fb6d 100644 --- a/.config/xorg/xinitrc +++ b/.config/xorg/xinitrc @@ -12,10 +12,6 @@ xsetroot -cursor_name left_ptr xset s off xset -dpms -# Customize keyboard layout -inputctl -k off -inputctl -k on - # Turn off touchscreen inputctl -s off diff --git a/etc/X11/xorg.conf.d/00-keyboard.conf b/etc/X11/xorg.conf.d/00-keyboard.conf new file mode 100644 index 0000000..dbc67c0 --- /dev/null +++ b/etc/X11/xorg.conf.d/00-keyboard.conf @@ -0,0 +1,7 @@ +Section "InputClass" + Identifier "system-keyboard" + MatchIsKeyboard "on" + Option "XkbLayout" "us" + Option "XkbModel" "pc104" + Option "XkbOptions" "caps:swapescape" +EndSection diff --git a/etc/systemd/logind.conf b/etc/systemd/logind.conf index 850b392..e107ff8 100644 --- a/etc/systemd/logind.conf +++ b/etc/systemd/logind.conf @@ -1,13 +1,14 @@ # This file is part of systemd. # -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. +# systemd is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. # -# Entries in this file show the compile time defaults. -# You can change settings by editing this file. -# Defaults can be restored by simply deleting this file. +# Entries in this file show the compile time defaults. Local configuration +# should be created by either modifying this file, or by creating "drop-ins" in +# the system.conf.d/ subdirectory. The latter is generally recommended. +# Defaults can be restored by simply deleting this file and all drop-ins. # # See logind.conf(5) for details. diff --git a/etc/udev/rules.d/00-usb-keyboard.rules b/etc/udev/rules.d/00-usb-keyboard.rules deleted file mode 100644 index 32d79b4..0000000 --- a/etc/udev/rules.d/00-usb-keyboard.rules +++ /dev/null @@ -1,13 +0,0 @@ -# -*- 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/.local/bin/inputctl -k on" - -# https://wiki.archlinux.org/index.php/Udev#Execute_on_VGA_cable_plug_in