From c274475635d410c0e9f812e71d20183cb923cd6b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 18 Feb 2024 13:22:42 +0100 Subject: misc updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- xorg-server/setkeys | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xorg-server') diff --git a/xorg-server/setkeys b/xorg-server/setkeys index 5837607..5837464 100755 --- a/xorg-server/setkeys +++ b/xorg-server/setkeys @@ -57,7 +57,7 @@ setxkbmap \ if test -z "${NO_UNICOMP}"; then # Unicomp's newer versions of New Model M swapped AltGr and RSuper # making it a torture device for even someone with as big hands as mine - if cat /sys/class/input/*/name | grep Unicomp > /dev/null; then + if (cat /sys/class/input/*/name; cat "${XDG_RUNTIME_DIR}/vmhostkeyboards" ) 2>/dev/null | grep Unicomp > /dev/null; then # Assign Compose to AltGr printf '%s\n' 'keycode 108 = Multi_key Multi_key Multi_key Multi_key' @@ -87,10 +87,11 @@ EOF if cat /sys/class/input/*/name | grep Unicomp > /dev/null; then # Turn off numlock LED - input="$(grep Unicomp /sys/class/input/*/name | sed 's|^/sys/class/input/\(.*\)/name:.*$|\1|g' | sed 1q)" + input="$( (grep Unicomp /sys/class/input/*/name; cat "${XDG_RUNTIME_DIR}/vmhostkeyboards" | grep Unicomp || :) 2>/dev/null | \ + sed 's|^/sys/class/input/\(.*\)/name:.*$|\1|g' | sed 1q)" if ! echo 0 | sponge "/sys/class/leds/${input}::numlock/brightness" 2>/dev/null; then if isfg; then - # TODO do at boot + # TODO do at boot asroot chown ${USER}:${USER} "/sys/class/leds/${input}::numlock/brightness" echo 0 | sponge "/sys/class/leds/${input}::numlock/brightness" fi -- cgit v1.2.3-70-g09d2