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

Add keyboard toggle script

This commit is contained in:
2016-04-17 15:32:03 +01:00
parent 3f7c08a0fd
commit d08637f5b7
3 changed files with 19 additions and 1 deletions

10
.config/i3/blocks/keyboard Executable file
View File

@ -0,0 +1,10 @@
#!/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)}'