diff options
Diffstat (limited to 'xorg-server/setkeys')
-rwxr-xr-x | xorg-server/setkeys | 7 |
1 files changed, 4 insertions, 3 deletions
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 |