Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

determine the current keyboard layout from a shell?

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
Piter_
Posts: 208
Joined: 2006-05-30 14:23

determine the current keyboard layout from a shell?

#1 Post by Piter_ »

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.

panta
Posts: 17
Joined: 2012-03-24 22:09
Location: Serbia

Re: determine the current keyboard layout from a shell?

#2 Post by panta »

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.

User avatar
debil
Posts: 1336
Joined: 2008-05-11 08:55
Location: Mazes of Menace, surrounded by brown puddings

Re: determine the current keyboard layout from a shell?

#3 Post by debil »

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.

Piter_
Posts: 208
Joined: 2006-05-30 14:23

Re: determine the current keyboard layout from a shell?

#4 Post by Piter_ »

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?

#5 Post by Piter_ »

Code: Select all

setxkbmap -print -v 8  | grep ^layout | awk 'END {print $2}'
This was my final solution
Joybook A52 laptop. Debian stable.

Post Reply