Easy way to have any symbol on your KB layout without pressing a million keys or additional software

rado84

Well-Known Member
Joined
Feb 25, 2019
Messages
776
Reaction score
632
Credits
4,916
This won't be useful for everyone but mostly to people who use office programs on a daily basis and often they have to make presentations or any other kind of official text documents. And sometimes they may need a special character - a symbol that is not normally present on the keyboard, let alone on any keyboard layout. So there's an easy way to have additional symbols. For this instruction I'm going to show you how to add the bullet point symbol, considering it's one of the most used symbols in documents. However, you can use this method to add any other symbols. But about that - a little later.

I'm using an Ubuntu-based distro but this method should work with all distros. If your distro's root command is anything different than 'sudo', simply replace that command with the one from your distro.

A note which you will need in order to understand terms like "level 1", "level 2", etc.
On the keyboard there are certain levels:
• Level 1 - small letters.
• Level 2 - capital letters which appear when you press 'Shift' + a letter key (Shift+G, for instance).
• Level 3 - above capital letters, usually brings up the symbol in the top right corner of the key (if any).
• Level 4 - above capital letters, usually brings up the symbol in the bottom right corner of the key (if any).

In some distros (such as Mint) the Levels 3 and 4 keys don't work properly, so use them by keeping in mind they might stop working at some point. These keys can be found in the settings where you add more keyboard layouts - those whose native language is not English surely know where that is.

So, you need a text editor. I prefer GEdit, so I'm gonna use it here and you can simply change the editor name in the command, if you're using something else. And to make things easier for yourselves, it would be better if you enable lines numbering in the editor's options.

You need to open a kb layout file:
Code:
sudo gedit /usr/share/X11/xkb/symbols/us

This will open the US layout config file for the keyboard.
Before editing anything you might wanna think of any symbol you have never used in your life before and you never will. Which makes it useless. In my case it was the pyramid-like symbol that appears when you press 'Shift+6'.

So, in the file find the line named
Code:
    key <AE06>
or simply look at line 12.

There, in the brackets are the characters which will appear when you press the corresponding key. The format in which they're written between the brackets is "Level 1, Level 2, Level 3, Level 4". Level 1 is the number six and Level 2 is the pyramid-like symbol. Sometimes, but not always, there might be even Level 3 for the ' = ' symbol. In my case there wasn't a Level 3 symbol.
So, we wanna replace that pyramid-like symbol with the bullet point one, so that when we press 'shift+6', it would produce a bullet point symbol. Simply make the whole line 12 look like this:
Code:
    key <AE06> {   [     6,   U2022   ]   };
Then hit Ctrl+S to save the file and close the text editor (terminal as well).
At that it's a good idea to backup the file somewhere safe, so that next time when you have to reinstall the operating system, you can easily restore the changed file (as root).

Using this method you can edit any other keyboard layout file (preferably one you never use) and create your own layout made entirely of symbols of your choice. Thus you won't have to deal with the not-always-working-level-3-and-4-keys AND you won't have to press tons of keys in order to bring up the desired symbol. For instance, that bullet symbol usually requires 'Ctrl+Shift+U' to be pressed and then type '2022' with the keys above the letters section. However, that's a little too hard to do (we don't have that many hands and fingers) plus it doesn't always work either.

I hope this instruction was useful to you and if it is, I wouldn't mind it if you simply click the "Like" button below my post. ;)

Here's a full list of the special characters codes (scroll down the page a bit):
https://fsymbols.com/keyboard/linux/compose/

P.S. Feel free to ask here, if you have any questions regarding the instruction.
 


Excellent post! Thanks for sharing :)
I took a look at the file just out of curiosity and found it quite interesting.
Code:
/usr/share/X11/xkb/symbols/us
One question though - do you think the white space is mandatory or just for aesthetics?
Code:
key <AE06> {   [     6,   U2022   ]   };
 
One question though - do you think the white space is mandatory or just for aesthetics?
Code:
key <AE06> {   [     6,   U2022   ]   };
No idea. Until I know more on the matter, I suggest you leave it as it is and edit only the the visible text.
 


Latest posts

Top