Skip to main content
2 of 4
added 259 characters in body
jasonwryan
  • 74.8k
  • 35
  • 204
  • 230

There is xkb-switch which is described thus:

xkb-switch is a C++ program that allows to query and change the XKB layout state.

https://github.com/ierton/xkb-switch

Or, following nozimica's suggestion, you could use:

setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}'

From this thread on the Arch Linux boards: https://bbs.archlinux.org/viewtopic.php?pid=539406

jasonwryan
  • 74.8k
  • 35
  • 204
  • 230