You are not logged in.

#1 2005-07-19 20:08:46

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

bash: getting current keymap

I'm writing a little bash script that will toggle the keymap.  I am currently using "setxkbmap -print|grep -q $KBD1" to check the current keymap. It's working fine for this case but I am wondering if there is a command that returns the current keymap.  I've read man pages for setxkbmap, xmodmap, etc but couldn't find anything.

#!/bin/bash

KBD1=us
KBD2=ca_enhanced

if setxkbmap -print|grep -q $KBD1
then
  setxkbmap $KBD2
else
  setxkbmap $KBD1
fi

Offline

Board footer

Powered by FluxBB