This script provides a keyboard layout indicator for dwmblocks
This commit is contained in:
BertramMiller 2020-05-15 21:53:09 -04:00 committed by GitHub
parent 6e476c459b
commit 4d7232a85f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,16 @@
#!/bin/sh
#requirements: dmenu, xorg-setxkbmap
# quick language switch:
lang1="us" #for English (US)
lang2="fr" #for French (CA)
#French can be replaced by any other language, for example:
# lang2="ua" #for Ukrainian (UA)
setxkbmap -query | grep "layout" | awk '{print $2}'
case $BLOCK_BUTTON in
1) [ $(setxkbmap -query | grep "layout" | awk '{print $2}') == $lang1 ] && setxkbmap $lang2 || setxkbmap $lang1 ;;
2) langselect ;;
3) notify-send "Language module" "\- Left click to quickly change between the $lang1 and $lang2 layouts
- Middle click opens dmenu for more language options" ;;
esac