How to get current keyboard layout in command line on all distributions ? Is it possible ?
E.g. xset -q | grep LED | awk '{ print $10; }'
shows different output with different keyboard layouts locally, but I've asked other people and I've noticed that for them it shows the same output even if their layout was changed. Is it possible, or did they do something wrong? Is there a clear/proper way to get the current exact keyboard layout?
I've started topic here, but it's clear that the solution depends on the distribution. There you can see that I've tried a lot of variants of getting this, but only xset
worked.
By the way, what command would you use for each distribution? For example, in a script which would execute it to get the current keyboard layout depending on the distribution. Or, which command will output CURRENT toggled layout for Fedora, for KDE Neon, Ubuntu, Debian, Arch, or Gentoo etc.?