ThinkPad X40 Tools (X11 xkb drivers, suspend/resume, bootup helpers, WiFi toggle) for Linux. May work on other X-models. Some of the scripts (like suspend/resume) could easily be adapted to other laptops.
The XkbInd program (XKB Indicator) is an indicator of keyboard
layout for the X Window System; it indicates current keyboard
layout in the title of top-level windows. XkbInd allows to
simulate independent keyboard layout for each handled window.