setxkbmap -print и setxkbmap -query
import commands
layout= commands.getoutput("xset -q|grep LED| awk '{ print $10 }' ")
if layout == '00001004':
print "en"
if layout=='00000000':
print "ru"
Feb 6 17:52:33 mj257 sshd[8658]: error: /dev/pts/3: No such file or directory
Feb 6 17:52:33 mj257 sshd[8658]: error: open /dev/tty failed - could not set controlling tty: No such file or directory