set -e                          # exit on errors
    # KDE installs my custom keymap when I log in, but if my keyboard
    # crashes and reboots — or gets unplugged and plugged back in — it
    # resets to the default keymap. So I wrote this script to restore my
    # custom keymap within a second if that happens. This is almost
    # certainly the wrong way to solve the problem, but it's pretty easy.

    while : ; do
        # My default keymap has no Multi_key, but my custom keymap does
        # (on keycode 108), which is how you can tell the difference. 
        if ! xmodmap -pk | grep -q Multi_key; then
            xmodmap ~/.Xmodmap
        sleep 1

(End of `xmodmapd`.)

This software is available via

    git clone http://canonical.org/~kragen/sw/inexorable-misc.git

(or in <http://canonical.org/~kragen/sw/inexorable-misc>) in the file

Like everything else posted to kragen-hacks without a notice to the
contrary, this software is in the public domain.
To unsubscribe: http://lists.canonical.org/mailman/listinfo/kragen-hacks

Reply via email to