Saturday, December 21, 2013

fbxkb - multi-language keyboard

Fbxkb does a simple job: sits in one's system tray and displays language status with a national flag. It's a GUI interface to bypass keystrokes for keyboard language switching.

One might guess fbxkb would be a 10MB app, but htop revealed fbxkb uses 156MB to do its thing. Luckily, my friend's system (on which it was needed) uses the relatively lean icewm Windows Manager. I found that 156MB did not affect performance. Additionally, the visual cue of a flag in the system tray saves guesswork. All told, satisfaction with fbxkb probably depends on a person's available RAM and their preference for a visual cue. Otherwise, just bind setxkbmap keystrokes (see below) and forgo fbxkb.


The system onto which fbxkb was installed runs ArchLinux so I used yaourt to put it in.
$ yaourt -S fbxkb


This friend wanted US and German keyboard options. I looked into /usr/share/X11/xkb/ for configuring, but we don't need to configure so deeply for a simple installation. Instead, add two lines to .xinitrc, and then invoke fbxkb with a single line in .icewm/startup:
$ nano .xinitrc
setxkbmap -layout us,de
# optional keystroke for shifting without GUI
setxkbmap -option grp:alt_shift_toggle 'us,de'

$ nano .icewm/startup
fbxkb &

This arrangement gave him the option to switch languages with Alt+Shift, or to switch using the fbxkb icon in the tray. Just click on the flag and it will toggle to the other flag, indicating the other keyboard mapping is operational. This also works for more than two languages. Although I just needed US and DE layouts, more options can be found here.

No comments: