in order to get AltGr+h, j,k,l or any other key without any application like Autokey to peform ←↓↑→ you can customize your keyboard layout found in /usr/share/X11/xkb/symbols/.
At the moment I use the german layout "de". So first of all I would:
1- copy the standard layout
cp /usr/share/X11/xkb/symbols/de /usr/share/X11/xkb/symbols/de.bak
2- open your layout with your text editor of preference (here: gedit)
sudo gedit /usr/share/X11/xkb/symbols/de
there you gonna see something like:
key <AD03> { [ e, E, EuroSign, EuroSign ] };
key <AD06> { [ z, Z, leftarrow, yen ] };
key <AD11> { [udiaeresis, Udiaeresis, dead_diaeresis, dead_abovering ] };
....
....
key <AD12> { [ plus, asterisk, dead_tilde, macron ] };
key <AC02> { [ s, S, ssharp, U017F ] };
key <AC06> { [ h, H, Left, Left ] };
key <AC07> { [ j, J, Down, Down ] };
key <AC08> { [ k, K, Up, Up ] };
key <AC09> { [ l, L, Right, Right ] };
....
....
key <AB10> { [ minus, underscore, endash, emdash ] };
key <LSGT> { [ less, greater, bar, NoSymbol ] };
As you can see, AB, AC, AD, AE represents the row, and the number represents its position on the keyboard (there are some special keys, like the less/greater key, which can be remapped to other keys as well..
There you will not find all the keyboard, just the ones that is diferent that the layout the keyboard is based on. The german one is based on "latin(type4)" as you can see on the beggining of the file:
include "latin(type4)"
Then you just need to change according to your needs. It works like:
key { [ key, key+shift, key+AltGr, key+Shift+AltGr ] };
(its also possible the add 5th level modifiers, or more)
if you want to check the changes without restart; (changing "de" for your layout... here is a list with possible layouts )
setxkbmap -layout de
The arrows are labelled just like "Left, Right, Down, Up", as expeceted. Here is a good list of possible values.
here is a example of my custom layout. (but not in use at the moment)
Then, you would need to remap Capslock and AltGr, or did it work already following the question you posted??
If you also want to keep a "normal" german layout, you can do the changes to another layout you dont normally use, (or change the "german no dead keys" which you can find further down at the same "de" file...)
Source: link to a very comprehensive explanation of xbk and custom layouts.
link to a similar question with a good answer.
/usr/share/X11/xkb/rules/{evdev,evdev.lst,evdev.xml}(Ideally, there should be directories likeevdev.lst.d, but apparently xkb didn’t think of that.) … Since my solution is not a complete answer, I’ll just add it as comments here, and people can modify their answers to include it. – Sep 27 '22 at 14:08evdevyou add a line likeMyOptions:my_option = MyOptions(my_option). Inevdev.lst, you addMyOptions = My own Options,MyOptions:my_option My great new optionfor (mandatory) descriptions, and inevdev.xmlyou add a new<group allowMultipleSelection="true">that is analogous to the others in the file, but useMyOptionsas group.configItem.name, andMyOptions:my_optionas group.option.configItem.name, with the same descriptions as inevdev.lst. – Sep 27 '22 at 14:18diff -uto make a.patchfile out of, respectivelyevdev,evdev.lst, andevdev.xmlwith and without the added lines (at the end), and then put thepatchcommands into a shell script file, together with aninstall -o root -g root -m 644 MyOptions /usr/share/X11/xkb/symbols/. Asetxkbmap -option MyOptions:my_optionenables the option from a command line or your shortcut. – Sep 27 '22 at 14:23MyOptionstoo. And contain the sectionxkb_symbols "my_option" { … }with only lines ofkeyand before them, a line ofkey.type[GroupX] = "SOME_GROUP"inside, that you need to look up from the key type in your original layout. (Because some keys have more shift levels than others. E.g. with my NEO 2.0 layout, I haveGroup1being"EIGHT_LEVEL_ALPHABETIC_LEVEL_FIVE_LOCK".) Nopartial …line is needed anywhere. – Sep 27 '22 at 14:30MyOptionsandmy_optionare arbitrary names, and you choose your own more descriptive one. :) … They just have to be the same everywhere. – Sep 27 '22 at 14:31MyOptions:my_option = MyOptions(my_option)must beMyOptions:my_option = +MyOptions(my_option). Note the added+. – Sep 27 '22 at 14:38