Where should my custom setxkbmap us_programmer
goto to make it persistent when I log into Ubuntu graphically and also from SSH?
1 Answer
If I would want to use that layout, this is how I would probably do it.
First add this variant to the bottom of /usr/share/X11/xkb/symbols/us
:
partial alphanumeric_keys
xkb_symbols "programmer" {
include "us(basic)"
name[Group1] = "English (US, programmer)";
key <AE01> { [ exclam, 1 ] };
key <AE02> { [ at, 2 ] };
key <AE03> { [ numbersign, 3 ] };
key <AE04> { [ dollar, 4 ] };
key <AE05> { [ percent, 5 ] };
key <AE06> { [ asciicircum, 6 ] };
key <AE07> { [ ampersand, 7 ] };
key <AE08> { [ asterisk, 8 ] };
key <AE09> { [ parenleft, 9 ] };
key <AE10> { [ parenright, 0 ] };
};
Then add this entry to /usr/share/X11/xkb/rules/evdev.xml
within the <variantList></variantList>
of the us
layout:
<variant>
<configItem>
<name>programmer</name>
<description>English (US, programmer)</description>
</configItem>
</variant>
After next login I can then add the layout in Settings -> Keyboard and use it as any other keyboard layout.
-
Really strange, i tried everything, but it does not work. Reboot etc. Is there anything else needed, it just does not show up in the menu. I added it correctly to the xml.– GabrielMar 22 at 10:05
-
@Gabriel: There is nothing else AFAIK. I actually did it successfully on my machine. Where in the menu did you look? You should choose "English (United States)", and then it should be included in the sub menu. Mar 22 at 10:14
-
1strange, it seems I had some issues with spaces not sure, however the thing was buggy, eventually it workes like you explained– GabrielApr 12 at 11:28
~/.profile
file.