M. Yas. Davoodeh 93ceef43c8 KBLayoutManager now aids multi-layout keyboards.
$KBLAYOUTS holds the list of languages to cycle thro.
The value of it must be space separated.

As an example I'm using Farsi/Persian (ir).
2020-01-31 17:51:18 +03:30

8 lines
579 B
Bash
Executable File

#!/usr/bin/env sh
# A simple module to print current KBLAYOUT
# Works best with my script of KBLayoutManager.
# This script sends the update signal and it is bound in i3/config.
lang=$(setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}')
[ "$lang" = "us" ] && color="#00ff00" || color="#ff0000" # This line is added to add awareness and ease to detect the us layout in a glance to be ascertain that your shortcuts and keystrokes will remain responsive # FIXME don't be coloured for us variations
printf "<span color='%s'>%s</span>\n" "$color" "$lang"