Set keymap after boot and after X

Post tutorials, HOWTO's and other useful resources here.
User avatar
bigbass
Contributor
Contributor
Posts: 151
Joined: 13 Jan 2012, 14:35
Distribution: slackware 14

Set keymap after boot and after X

Post#1 by bigbass » 06 Oct 2012, 17:10

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

Joe


# 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

#!/bin/sh

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

EOF

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
#========================================