2

I want I J K L to function as arrow keys when CapsLock is pressed down. To do this, I pasted the following to the bottom of the /usr/shar/X11/xkb/symbols/pc file:

partial  partial alphanumeric_keys
xkb_symbols "alpha_arrows" {

    key <AC07>  { symbols[Group2]=[ Left,      Left,      Left,      Left      ] };
    key <AC08>  { symbols[Group2]=[ Down,      Down,      Down,      Down      ] };
    key <AC09>  { symbols[Group2]=[ Right,     Right,     Right,     Right     ] };
    key <AD08>  { symbols[Group2]=[ Up,        Up,        Up,        Up        ] };

};

I then added the following command to my .bashrc file:

setxkbmap -option grp:caps_switch

This indeed disables CapsLock and allows Alt-CapsLock to toggle the caps lock command. My understanding is that holding CapsLock down should activate the "Group2" key bindings that I set up above... But this simply doesn't happen.

I've tried clearing the cache using rm -rf /var/lib/xkb/* and the restarting the machine several times. Still no dice. Notably, I was able to swap Left-Control and Left-Super, so I know that xkb/symbols/pc is the right file to edit.

Questions:

  • Is there a way to check/confirm that "Group2" is activated? As you may be able to tell, I only have a tenuous grasp on how this works.

  • Is it valid to just paste that block of code at the bottom of the xkb/symbols/pc file?

  • Is there an equally easy alternative to remap these keys? I'd also be interested in remapping Home, End, etc...

References that have got me this far:

Note: This question seems to be have been asked in various forms around the internet, and I was hesitant to add more noise to the system. But a lot of what I've read has used xmodmap which is now (apparently) outdated. And AutoKey made me want to stab my eyes out.

0

I have just added my custom layout to the gui in elementary OS Loki.

To add my custom layout I do the following:

  1. edit existing xkb/symbols/ru file to add my layout there;
  2. edit evdev.xml file to add the appropriate variant there;
  3. edit evdev.lst file to add the appropriate variant there;
  4. edit base.xml file to add the appropriate variant there;
  5. edit base.lst file to add the appropriate variant there;

It seems, you don't do the steps #3,4,5.

Could you try it and report back?

EDIT:

  1. I've made some testing and ready to say, that the layout definetely appears in the GUI after editing evdev.xml AND evdev.lst.

  2. The appropriate variant seems to be: xkb_symbols "alpha_arrows" so one should add to evdev.lst the following line:

    alpha_arrows gb: Doms l33t layout

  3. Editing base.xml and base.lst seems to be redundant and unnecessary.

EDIT2: Additionally, there seems to be an error in the initial guide. One should add to the evdev.xml

<layout>
  <configItem>
    <name>alpha_arrows</name>
    <shortDescription>endom</shortDescription>
    <description>Dom's l33t layout</description>
    <languageList>
      <iso639Id>eng</iso639Id>
    </languageList>
  </configItem>
  <variantList />
</layout>

Screen of Custom Layout in the GUI

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.