dotfiles/.local/bin/scripts/update-keyboard-layout

8 lines
238 B
Plaintext
Raw Normal View History

#!/bin/sh
2021-03-01 08:58:21 +00:00
echo $XDG_RUNTIME_DIR
test "$ACTION" && case $ACTION in
add) id=1;;
remove) id=0;;
esac || id=$(test -c /dev/ttyACM0 && echo 1 || echo 0)
2021-03-01 08:58:21 +00:00
test "$id" && XAUTHORITY="/run/user/1000/Xauthority" DISPLAY=:0 xkblayout-state set $id