setxkbmap -printnot useful in this case, which was also my first idea. I found a small tool , very easy to compile
sudo apt-get install git
mkdir -p `~/src`
cd `~/src`
git clone https://github.com/nonpop/xkblayout-state.git
cd xkblayout-state
make
Now you can run the command ./xkblayout-stateto get the current layout, for example.
./xkblayout-state print "%n"
German%
or a list of all installed layouts
./xkblayout-state print "%N"
German
English
English
%. , \n.