Xkblang is a simple program for getting current keyboard layout. Primarily this program was written for i3blocks blocklet for getting current layout.
Xkblang written on pure C. The only dependency is libX11.
$ make
$ sudo make install
OR with deb packet:
$ dpkg -i xkblang_1.0-1.deb
$ xkblang -p
English (US)
For short version:
$ xkblang -ps
En
To list all available layouts:
$ xkblang -l
0. English (US)
1. Russian
To set layout:
$ xkblang -t 0