Answer the question
In order to leave comments, you need to log in
How to get the current X11 layout?
Help correctly, least "crutch" to get the current X11 layout.
Now this option is used: The skb
utility from a little-known author is installed, respectively, it is not included in any distribution kit.
In Python code I use it like this:
import subprocess
keyboard = subprocess.check_output(['skb', '-now']).strip()
Answer the question
In order to leave comments, you need to log in
setxkbmap -print and setxkbmap -query
import commands
layout= commands.getoutput("xset -q|grep LED| awk '{ print $10 }' ")
if layout == '00001004':
print "en"
if layout=='00000000':
print "ru"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question