How to get current gnome keyboad layout from terminal
- by ftiaronsem
For usage in a bash script, I need to get the gnome keyboard layout the user is currently using. For example if the user sets its keyboard layout to en-us , I need a bash command that prints me this.
How can I get that information?
Update:
setxkbmap -query is unfortunatelly not working. Below is the ouput with the en (first command) and the de (second command) layout activated. Switching keyboard layout seems to be have some relation with gnome session configuration
setxkbmap -query
rules: evdev
model: pc105
layout: us,de
variant: ,
options: terminate:ctrl_alt_bksp,lv3:ralt_switch,grp:alts_toggle
setxkbmap -query
rules: evdev
model: pc105
layout: us,de
variant: ,
options: terminate:ctrl_alt_bksp,lv3:ralt_switch,grp:alts_toggle