April 2017

S M T W T F S
      1
2345678
910111213 1415
16171819 2021 22
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Thursday, March 13th, 2008 08:03 pm

I have finally succeeded in my quest, to get XKB to easily set up the keyboard in an arbitrary fashion, not limited to the options presented in the rules database, using the system database for everything I'm not explicitly overriding, without needing to edit any system files or have any special privileges!

This should allow me to map CapsLock to Super (or Esc, or something else, I'm still playing) on any computer I have an account on.

  1. Make an xkb symbols file with the new symbols you want. Pattern after the stuff in /usr/share/X11/xkb/symbols/. Mine is called capslock and looks like this (there's actually more in there, but it's not relevant):

    // use the capslock key as a(nother) Super key
    partial modifier_keys 
    xkb_symbols "super" {
        key   {  symbols[Group1]= [ Super_L ] };
    };
    

  2. Put it in a directory called symbols, and put that somewhere useful. I recommend $HOME/.xkb/symbols
  3. Make a keymap .xkb file and put it somewhere useful (probably in $HOME/.xkb/keymap/my_keyboard.xkb or something. It should look something like:

    xkb_keymap {
            xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
            xkb_types     { include "complete"      };
            xkb_compat    { include "complete"      };
            xkb_symbols   { include "pc+us(altgr-intl)+level3(ralt_alt)+level3(menu_switch)+capslock(super)"        };
            xkb_geometry  { include "pc(pc105)"     };
    };
    

    Notice the +capslock(super) part; that's what's calling the new symbols. You can generate a file for the stock options you like by calling setxkbmap -print [options].

  4. Add the following to a file which will be consistently called when X starts under your username. Mine is in .xprofile, which is also sourced from .xinitrc.

    # Set up the keyboard the way we like it
    xkbcomp -I$HOME/.xkb $HOME/.xkb/keymap/my_keyboard.xkb $DISPLAY
    

Tags:

Reply

If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org