Skip to content

Instantly share code, notes, and snippets.

@apux
Last active December 24, 2015 23:19
Show Gist options
  • Save apux/6879834 to your computer and use it in GitHub Desktop.
Save apux/6879834 to your computer and use it in GitHub Desktop.
change kde keyboard layout
#!/bin/sh
# query xkb map: us,latam -> us is primary; latam,us -> latam is primary
dummy=`setxkbmap -query | grep us,latam`
# return value 0: us,latam; return value != 0, latam,us
if [ $? -ne 0 ]; then
# latam is primary, now make us primary in list
setxkbmap -model pc101 -layout us,latam -variant nodeadkeys
else
# us is primary, now make latam primary in list
setxkbmap -model pc101 -layout latam,us -variant nodeadkeys
fi
# taken from kate-editor.org/2013/10/07/multiple-keyboard-layouts-and-shortcuts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment