[Novalug] SOLVED: Capslock > ESC

luigi12081@cox.net luigi12081@cox.net
Sun Feb 18 18:22:05 EST 2007


Thanks to the helpful RTFM pointers I received here last week, I was
able to solve my keymapping problem.

It turns out that in Ubuntu (and Debian), console fonts and other like
settings are handled by the console-tools package.  The relevant config
files live in /etc/console-tools : 

/etc/console-tools/config

handles general console setup.  I ended up editing this to give me the
console font I wanted.

for keymapping, you have to edit

/etc/console-tools/remap

which is nothing more than a script that runs sed on the output of
dumpkeys.  The example script turns the capslock key into a control
key, which doubtless will bring great joy to all you dumb terminal guys
out there.  *I*, however, modified it suitably to give me the escape key
that I wanted there. 

The config files in /etc/console-tools are called by the init script at
/etc/init.d/console-screen.sh, so to reflect any changes, we have to 

sudo /etc/init.d/console-screen.sh restart

Ubuntu Dapper, for some reason, does not run
/etc/init.d/console-screen.sh at startup. so, we have to make it do so.
I ended up adding a line to /etc/rc.local to make it load on startup.  

In X, we have to run xmodmap at start.  First, we create
~/.Xmodmap, filling it with the following:

! Esc on caps lock
remove Lock = Caps_Lock
keysym Caps_Lock = Escape

then we add the following lines to ~/.xinitrc

if [ -f ~/.Xmodmap ]; then
      xmodmap ~/.Xmodmap
              fi

save, and restart X.  All is right with the world, at least for vim
users.

I figured I owed this mailinglist a full report, having successfully
learned a thing or two.  For those of you who have been using TTYs since
the time that they were actually teletypes, I apologize once again for
wasting your time.  Your declining years should not be spent responding
to basic questions.  Please go back to whatever it is you old folks do
when I'm not looking.

-Luigi



More information about the Novalug mailing list