Answer the question
In order to leave comments, you need to log in
How to track keyboard layout changes from the command line?
I installed linuxmint cinnamon 19.3
I set up two layouts us and ru everything works, the layout switches, in the panel the indicator shows that the layout has switched. All OK.
The task is to get the current keyboard layout from a bash script.
I tried the method that I used in another distribution:
dconf watch /org/gnome/desktop/input-sources/current
dconf watch /org/cinnamon/desktop/input-sources/current
Answer the question
In order to leave comments, you need to log in
through crutches:
in the settings of the keyboard, when using a different layout, "light the LED"
Use keyboard LED to show alternative layout Scroll Lock
i.e.
if the LED is on, it means RU (returns 1), if there is no EN (returns 0)
, I get the values as follows
xset -q | sed -rn 's/.*LED mask.*(.){3}/\1/p'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question