Skip to content

Instantly share code, notes, and snippets.

@ik9999
Created January 6, 2016 01:36
Show Gist options
  • Save ik9999/2e08d532fdbee32516e7 to your computer and use it in GitHub Desktop.
Save ik9999/2e08d532fdbee32516e7 to your computer and use it in GitHub Desktop.
Current keyboard layout
#!/bin/bash
layoutsStr="$(setxkbmap -print -v 8 | grep ^layout | awk 'END {print $2}')"
layoutsList=(${layoutsStr//,/ })
layoutIdx="$(xset -q|grep LED| awk '{ print $10 }'|cut -c5)"
echo "${layoutsList[$layoutIdx]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment