X Keyboard Extension (XKB) has become an integral part of XFree86 and provides an easy and elegant way to customise your keyboard. This is especially important for the users of a non-Latin alphabet. Since nowdays you can hardly imagine a computer capable of working without being able to enter Latin characters, you typically have two or more alphabets, or , using XKB jargon, key groups.
XKB codes the groups according to the country or locale. A "classic" example is the difference between US and UK keyboard, whith # for US and £ for UK, while fr (French) and and fr_CH (Swiss French) are significantly different as AZERTY vs QWERTY. Starting with XFree 86 v 4.3.0 you can mix up to four dirrerent groups in a XKB layout, and this is not an "overkill" especially for multinational countries.
wmxkb provides a convenient way to operate a multigroup layout: it
indicates current group and allows switching groups with a single mouse
click. You can also use wmxkb to assign aditional (e.g. mutimedia)
keys for switching between groups, or setting a particular group, run
a script whenever a particular group is activated (for changing locale,
font lookup directories etc).
The application is designed to be as much self-aware as possible. It should be able to figure out which key maps are being used, in particular you can get settings unaffected by the XKB layout in use. Currently this feature is experimental (see Flexible groups section).
Typically wmxkb is used as a dockable/swallowed applet with Window Maker or any window manager that supports docking or swallowing, including afterstep, blackbox and clones (incl. fluxbox), gnome v1, kde v1, fvwm and clones. If your window manager does not support swallowing, you can run the applications as a "normal" window.
V 1.0.0 and 1.1.0 October 2003
v 1 2.0 December 2003
./configureThere are several ./configure -with options appearing at the end of ./configure --help In particular you can enable using XInput in a (rather hypothetical) case of several keyboards connected to your computer. Shape extension is also disabled by default, if you wish to use your own background pixmap you might need to enable it. Finally you can disable silly images and save several Ks!
cp Makefile.linux MakefileIf compilation succeeds, type
cp wmxkb_conf.h.linux wmxkb_conf.h
./wmxkband see how it goes.
make installNow you only need to get it docked or swallowed. See Running wmxkb as a docked / swallowed applet for the hints.
rpm -Uvh wmxkb-1.2.2-1.i386.rpm
If you use a source distribution, just turn it into a binary with
rpm --rebuild wmxkb-1.2.2-1.src.rpmthe compiled (binary) rpm is usually stored in /usr/src/redhat/RPM/i386.
As usually, command line keywords start with a hyphen(-). You only need to enter as many characters as needed for unique recognition of the keyword. The value if needed) is separated from the keyword by a space, e,g,
wmxkb -geom 64x64
where geom is a short word for geometry .
The description of configuration parameters follows.
Specifies display name (e.g. grumpy.mynet.net:0), default display is used is omitted.
Display list of command line arguments and quit. The list is sent to
standard output file.
Help pages is also displayed in case of command line error, in which case it is followed by an error message.
The existing resource parameters are combined with command line arguments (which overwrite resource settings if necessary) and the combined set of is stored as the user resource file.
wmxkb -save -bgcol "nave,red" -fgcol "yellow,white"Next time you just type wmxkb to run with specified colours.
The following setings apply to the application as a whole (i.e. not
As is common for an X11 application, geometry specfifies size and/or position of the window in format:
-nogeometry disables geometry, specified as a resource. This implies size 54 x 54 and default window location.
The window size affects its appearence. Two background images
size 54x54 and 44x44 are provided and if image is required the
application will choose the one which fits, or no image if width or
height is less than 44.
xoffset and yoffset are interpreted as offsets from left / top screen border, if positive, or from right / bottom border , if negative. An offset is always evaluated from nearest window boundary.
Explicitly specified window location normally results in
suppressing window manager placement policy. This might be useful
if a window manager is configured for manual (mouse) placement,
especially with fvwm: GoodStuff will naively attempt mouse placement
even for a swallowed
window ! Another example when explicit location is needed for a swallowed application is related to FvwmButtons module (used most often with fvwm2) : with some versions of FvwmButtons the application window will appear on the desktop for a short time during FvwmButtons initialization. If that annoys you, you just need to set location "off-screen" (-geometry 48-2000-1500).
wmxkb. textGeometry: <geometry>
Specifies position and size of of the text window:
As opposed to window geometry (or 'just' geometry) text coordinates
(xoffset and yoffset) are given relative to application window. As in
case of window geometry either or both xoffset and yoffset may be
-notgeometry disables textGeometry, specified as a resource. This implies default text location location at the bottom of application window.
wmxkb.windowMode: <Docked, Window, Iconic, Guess>
Window mode can be one of the following:
Run application as a window or as an icon. Possible mode values are:
-docked -wnd and -iconic are equivalent to -wmode d , -wmode w , and -wmode i respectively.
Docked Run as a docked icon (main window is withdrawn). Suits WindowMaker, BlackBox and clones Window Run in window mode (main window is mapped, icon is not created). Suits gnome, kde, fvwm, or in case docking/swallowing is not required. Iconic Start with main window iconified. Normally used in combination with -ititle argument Guess (default) The application will try to figure out which mode (Docked or Window) will be the best for your window manager.
wmxkb.iconTitle: <boolean>Show current keyboard group information as icon name. Some window managers (FluxBox, fvwm) display icon names for iconified applications, so that you can see current group name, when the application runs as an icon. To start the application as an icon use -wmode i.
If the application was compiled with background image support, you can specify one of the following modes:
V(variable) or 2 Try to use a specific image for a group. The image name is <symbolic_name><size>.xpm, where size is 54 or 44, e.g. de54.xpm Germany, window size 54x54 or more, de44.xpm Germany, window size 44x44 or more, but less than 54x54. If this image is not found, the default background image is used. The application comes with flag images for some countries. F(fixed) or 1 Use default background image with all groups N(none) or 3 Don't display an image
Default - Variable.
wmxkb.imageDir: <directory>If the application was compiled with background image support, this parameter defines the directory containing background and all custom images. By default the directory specified by --with-imagedir argument for configure, or $prefix/share/pixmaps/wmxkb is used .
If the application was compiled with background image support, this
parameter defines file name of default background image. If omitted,
wmxkb_54.xpm, or wmxkb_44.xpm is used depending on window size.
Apply/don't apply transient hint to the application window. This might affect window decoration. Some WM (like kwm v.1) hide iconify button for a transient window which allows seing the caption, some others (fvwm and clone) can be configured not to draw a caption for a transient window. Default: -notransient
In case XInput extension is enabled and several keyboards are connected to your computer, you may select the one you are interested in. The device order (as opposed to device ID) refers only to keyboard devices - default (core) keyboard usually has devorder 0, second keyboard has devorder 1, etc. The choice of keyboard also applies to function keys . Keyboard device lookup is done using XInput extension. If device order is 256, which is same as -coredev , or XInput support is excluded, the appllication will avoid looking up device and use core keyboard - this is probably what you usually want.
If yhe application is configured to use Shapes extension (with is not
the default), you can disable / enable it. This is left for purely
nostalgic reasons - current background images don't need Shapes.
wmxkb.titleSource: < Code, Group, User>
The source used as group name:
S (Symbol) or 0 - usually country code ('us", "ru", etc) this is the default
G (Group) or 1 - group name ("US / ASII", "Russian", etc)
U (User) or 2 - custom group name specified as name resources
Each mode has advantages and disadvantages. The symbol is normally a
two letter word ( sometimes 5 letters: fr_CH), which appears to be a
right choice, however it might not always be retrieved correctly.
Retrieving group names appears to be more straightforward, but ... they
are not guaranteed to exist. I noticed that Japanese group names
missing that required patching the problem in my code. Is Japanese is
the only one having the problem ?.. At last, you can supply custom
names, in which case the names are not taken from the system and might
wmxkb.fwdSwitchKey: <scancode-modifier>Assign a key for switching to next key group. See Function keys section.
wmxkb.backSwitchKey: <scancode-modifier>Assign a key for switching to previous key group. See Function keys section.
See Flexible groups section. Default is False ("stiff" groups).
The following settings are group-specific. The application provides a shortcut facility where settings for all groups can be entered as a simgle command line argument sepparated with commas or semicolons, e.g.
wmxkb -fgcol "yellow, white " -bgcol "navy" -saveis equivalent to
wmxkb -fgcol1 yellow -fgcol2 white -bgcol1 navy -saveand produces the following resources:
If number of settings is less than number of groups, the settings
are assumed to be repeated. In particular, one value applies to all
groups. In the example above groups 1 and 3 will use 'yellow on
navy", groups 2 and 4 use "white on navy"
Custom group name. Used if title source
Used to to identify a "flexible" group. See
Flexible groups section.
"red" , "#ff0000", "#ffff00000000"
Text background colour. If image is not displayed, this colour is
used for paining the whole window
Frame colour. Used to draw an area outside the image in case image
size is less than window size.
Ignored if no image is displayed.
Font used for drawing the title, given in HPCE format (e.g. . "
or as an alias (e.g. "5x8"). If the font is not specified, the application will try "6x13" and then " fixed ".
You may be able to print each group name in its native language by specifying appropriate fonts.
A key used as a shortcut for switching to this group. See
Function keys section.
A key used as a shortcut for latching the group: the group will apply to next entered charecter only. See Function keys section.
A command to run when the group become active. This is typically a
shell script, that may change the locale, change font lookup directory
You can use mouse clicks in the following way:
Right mouse click - go to next group
Left mouse click - go to previous group
Midle mouse click, or Ctrl+Right mouse click - quit apllication
The groups are wrapped: first group follows the last in forward
sequence, and last group follows the first in backward sequence. In
particular, in case of two groups left and right clicks are
practically equivalent. Avoid "Kill" where possible, use mouse clicks
As opposed to setkey (set a group permanently), latchkey applies the group only to next entered character.
-fwdswitch <key> go to next group -backswitch <key> go to previous group -setkey <key1,key2,..> set a particular group -latchkey <key1,key2,..> latch a particular group
wmxkb -fwdswitch 163 -backswitch "163-1" -setkey "144,164,133" -latchkey "144-1,164-1,133-1" -save
# Common settingsThis works OK as long as the XkbLayout (in XF86Configure) is "us,ru". If you change the layout to "ru,us" you need to swap group descriptions.
# English (US keyboard)
# Cyrillic (Russian keyboard)
# Common settingsIn "flexy" mode, the application retrieves symbolic name of current group (us or ru) and scans group description for the match. If matching group is found, its settings are applied, otherwise the group is choosed according to the XKB layout order.
# English (US keyboard)
# Cyrillic (Russian keyboard)
Press OK and hopefully the window appears.
Title: wmxkb Command: wmxkb -geom 54x54 (large panel size or more)
wmxkb -geom 44x44 (medium panel size)
Width and height: 60x60 (large panel size)
50x46 (medium panel size)
In the appearing kfm form, select Execute tab and type a text similar to the following:
Execute (on top)You can't control the applet in run time with the mouse, but you can use swallowed icon as a link: clicking it with left button starts the application in non-swallowed mode.
wmxkb -transient -geometry 54x54-0+5 -wnd
Swallowing on panel
Execute: wmxkb -geom 44x44
Window Title: wmxks
Run in terminal: NOT ticked.
Select OK to create a new icon on the desktop
Drag the icon to panel and wait till the aplication start.
*GoodStuff wmxkb None Swallow "WMxkb" wmxkb -geom 44x44+0+0 &
If you use fvwm2 or fvwm95 and FvwmButtons module with normal icon size (e.g. Module FvwmButtons appear in InitFunction list without MiniButtons parameter), add the following line to ~/.fvwm2rc ( ~/.fvwm95rc for fvwm95):
*FvwmButtons wmalms NULL Swallow "WMxkb" Exec wmxkb -geometry 44x44+2000+1500
(The huge offset is needed in order to get the window offscreen. See
comments regarding -geometry ).
This program 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.
You should have received a copy of the GNU General Public License along with this program; if not, write to the
675 Mass Ave, Cambridge, MA 02139, USA.
Please send comments (of any kind, but relevant to the sotware!) to me (Michael Glickman): firstname.lastname@example.org .
PLEASE DON'T USE THIS ADDRESS FOR ANY IRRELEVANT MATERIAL !
Check Web for my other GNU Linux and X11 applications: