1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00
dotfiles/.config/i3/blocks/keyboard

11 lines
329 B
Plaintext
Raw Normal View History

2016-04-17 14:32:03 +00:00
#!/bin/sh
[[ $BLOCK_BUTTON -eq 1 ]] && `$DOTFILES/scripts/togglekeyboard`
layout=$(setxkbmap -query | grep 'layout:' | awk '{print $2}')
variant=$(setxkbmap -query | grep 'variant:' | awk '{print $2}')
short=`([ "$variant" ] && echo $variant || echo $layout) | cut -c1-2`
echo -e "$short\n$short" | awk '{print toupper($0)}'