Page 1 of 1

Set keymap after boot and after X

Posted: 06 Oct 2012, 17:10
by bigbass
I had seen a post talking about this for xfce but I couldn't find the thread
so I started this thread that fixes the problem
I am currently on slackware 14 using xfce to verify the steps
and I will add this was a tricky problem to solve for those that were fighting with this also.
My theory is since a .Xmodmap isn't found everything defaults back to English


# change your keyboard language spanish is used here as the example "es" for espaƱol you must run this first !

Code: Select all

setxkbmap es

# make this local setting your keycodes by generating a keymap

Code: Select all

xmodmap -pke > ~/.Xmodmap

# now make this global with all desktops by making a copy here

Code: Select all

cp ~/.Xmodmap /etc/X11/xinit/


# if you want to set your console at boot up to display spanish do this
# make a file called set_spanish_keyboard in /etc/profile.d then make it exectutable
# that contains this this is done automatially with the code below

cat << 'EOF' > /etc/profile.d/set_spanish_keyboard


# This must come after the lang script is run
setxkbmap es
export LANG=es


Code: Select all

chmod a+x  /etc/profile.d/set_spanish_keyboard

#=========reset original default===========
# to undo and set the original default again un comment this

Code: Select all

#rm ~/.Xmodmap

#rm /etc/X11/xinit/.Xmodmap