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

12 lines
368 B
Plaintext
Raw Normal View History

2016-04-17 14:32:03 +00:00
#!/bin/sh
[[ $BLOCK_BUTTON -eq 1 ]] && `$DOTFILES/scripts/togglekeyboard`
2016-04-23 12:54:25 +00:00
[[ $BLOCK_BUTTON -eq 3 ]] && onboard &
2016-04-17 14:32:03 +00:00
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)}'