def get_x():
 cmd = 'setxkbmap -query | grep layout'
 out = __salt__['cmd.run'](cmd, python_shell=True).split(':')
 return out[1].strip()

def get_x ( ) : cmd = 'setxkbmap -query | grep layout' out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = True ) . split ( ':' ) return out [ 1 ] . strip ( )
get current x keyboard setting cli example: .