Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Switch layout of keyboard in X11
#!/bin/bash
#
# switch keyboardlayout of my external cherry keyboard to german layout
#
set -e
DEV_NAME="HID 046a:0023"
LAYOUT="at"
DEV_ID=`xinput list --id-only "keyboard:$DEV_NAME"`
exec setxkbmap -device $DEV_ID -layout $LAYOUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment