determine the current keyboard layout from a shell?

Everything about X, Gnome, KDE, ... and everything running on it

determine the current keyboard layout from a shell?

Postby Piter_ » 2012-07-24 07:30

Hi all.
How can I determine the current keyboard layout from a shell?
(I have two layouts in use)
Thanks
Joybook A52 laptop. Debian stable.
Piter_
 
Posts: 208
Joined: 2006-05-30 14:23

Re: determine the current keyboard layout from a shell?

Postby panta » 2012-07-24 21:41

Try
Code: Select all
xset -q|grep LED| awk '{ print $10 }'|cut -c5

This will give you 0 for the default layout and 1 for the other one.
panta
 
Posts: 17
Joined: 2012-03-24 22:09
Location: Serbia

Re: determine the current keyboard layout from a shell?

Postby debil » 2012-07-24 22:21

Try
Code: Select all
$ setxkbmap -print

Check out the line with xkb_symbols in it.
Q: Why is the Eunux kernel so bloated?
A: It was made in the image of its founder.
User avatar
debil
 
Posts: 1337
Joined: 2008-05-11 08:55
Location: Mazes of Menace, surrounded by brown puddings

Re: determine the current keyboard layout from a shell?

Postby Piter_ » 2012-07-25 06:43

debil wrote:Try
Code: Select all
$ setxkbmap -print

Check out the line with xkb_symbols in it.

This will only show the available layouts
panta wrote:Try
Code: Select all
xset -q|grep LED| awk '{ print $10 }'|cut -c5

This will give you 0 for the default layout and 1 for the other one.

This may work.

Thanks
Joybook A52 laptop. Debian stable.
Piter_
 
Posts: 208
Joined: 2006-05-30 14:23

Re: determine the current keyboard layout from a shell?

Postby Piter_ » 2012-09-20 10:32

Code: Select all
setxkbmap -print -v 8  | grep ^layout | awk 'END {print $2}'

This was my final solution
Joybook A52 laptop. Debian stable.
Piter_
 
Posts: 208
Joined: 2006-05-30 14:23


Return to Desktop & Multimedia

Who is online

Users browsing this forum: Grell, peter_irich and 13 guests

fashionable