*xkblayout-state* is a small command-line program to get/set the current XKB keyboard layout.
It's a thin wrapper around a modified version of Jay Bromley's XKeyboard class, the original of which is included in <http://members.dslextreme.com/users/jbromley/files/ruby-xkb.tar.bz2>.
Compilation and installation
----------------------------
- To compile just say: `make`
- To install copy the resulting executable `xkblayout-state` somewhere in your path
Usage
-----
*xkblayout-state* can be used to either print keyboard layout information on **stdout** or set the currently active layout.
### Printing keyboard layout information
The command to print keyboard layout information is
-`%E` -> A list containing the variants of the layouts (one per line; *if no variant is specified for the respective symbol, the layout symbol is used*)
The command to set the currently active keyboard layout is
xkblayout-state set [+-]number
*number* is the number of the layout to activate. It corresponds to the layouts in the order they appear in, for example, `xkblayout-state print %N`, starting from zero. If *number* begins with a plus or minus sign, the *number*'th layout counting from the currently active layout down or up the list is activated. It wraps around if the list is exceeded.
License
-------
*xkblayout-state* is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
*xkblayout-state* is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. <http://www.gnu.org/licenses/>