aboutsummaryrefslogtreecommitdiffstats
path: root/xorg-server/setkeys
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-02-18 13:22:42 +0100
committerMattias Andrée <maandree@kth.se>2024-02-18 13:22:42 +0100
commitc274475635d410c0e9f812e71d20183cb923cd6b (patch)
tree70f59c3b28a36921ea46a93effc565d59e20f43b /xorg-server/setkeys
parentAdd makeenv (diff)
downloaddotfiles-c274475635d410c0e9f812e71d20183cb923cd6b.tar.gz
dotfiles-c274475635d410c0e9f812e71d20183cb923cd6b.tar.bz2
dotfiles-c274475635d410c0e9f812e71d20183cb923cd6b.tar.xz
misc updates
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'xorg-server/setkeys')
-rwxr-xr-xxorg-server/setkeys7
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