Created
November 21, 2016 19:59
-
-
Save sixtyfive/211ccd5e980fd98bff9111ded4ff1b07 to your computer and use it in GitHub Desktop.
New i3blocks block for displaying current keyboard layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Save as /usr/share/i3blocks/kb_layout, then use it by | |
# adding something like this to your i3blocks configuration: | |
# | |
# [kb_layout] | |
# interval=3 | |
KB_LANG=$(setxkbmap -query | grep layout | cut -d ':' -f 2) | |
KB_LANG=${KB_LANG//[[:space:]]/} | |
echo $KB_LANG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my case
setxkbmap -query
returns all layouts installed not the current one.