Custom keyboard layout is reset to default after standby or reboot

keyboardkeyboard-layoutx11xfce

I designed a keyboard layout for myself, after I run xmodmap it works OK, but after standby or reboot, the layout turn back to qwerty.

How can I set it as default? My OS is Debian Wheezy with XFCE4.

Best Answer

Check out this archlinux forum thread Xmodmap Reset after Suspend to RAM. There are several examples in the thread that'll get you started and show you how to setup a hook which will get triggered via the power management subsystem that will run your xmodmap setup each time you come out of suspend.

Something like the following script, saved as /etc/pm/sleep.d/11suspend (change the me in /bin/su - me to your actual username):

#!/bin/bash
case $1 in
    hibernate)
        echo "Hey guy, we are going to suspend to disk!"
        ;;
    suspend)
        echo "Oh, this time we're doing a suspend to RAM. Cool!"
        ;;
    thaw|resume)
        echo "oh, suspend is over, we are in $1 phase..."
            # Set Display #
    DISPLAY=:0.0 ; export DISPLAY
    /bin/su - me -c "sleep 3; /usr/bin/xmodmap /home/me/.xmodmaprc" &
        ;;
    *)  echo "somebody is calling me totally wrong."
        ;;
esac
Related Question