0

I am using as OS Ubuntu 20.04.6 LTS and I have an American keyboard. From time to time I need to type Russian special characters (e.g. ё). Is there a way/program to create my own custom shortcuts that will type out my desired characters (e.g Alt+e+~ = ё)?

zx485
  • 2,426
NeStack
  • 275

1 Answers1

1

Your keyboard shortcuts (in the main for special characters) are assigned in the file usr/share/X11/locale/en_US.UTF-8/Compose If you want to add your own: use a text editor to create a new file in your Home directory named .XCompose with contents

include "%L"

<Multi_key> <t> <q> : "the quick brown fox" <Multi_key> <e> <asciitilde> : "ё"

where include "%L" brings in the default sequences and the other lines specify the key sequences and their resultant text. Others can be appended to the file contents.

In this case we're using 'Multi_key' also know as 'Compose' as the first designator. As modern keyboards don't tend to have a 'Compose' key you'll need to assign one on your keyboard. I use 'Alt Gr' aka 'Right Alt'. To do so go into Settings - Keyboard. Select Layout and Options. Scroll down to find '> Position of Control Key' and assign it to the key you want to use (e.g. Right Alt).

Now when you type the sequence 'Right Alt' t q the text the quick brown fox appears.

Note that having made any changes to your .XCompose file you'll need to restart the application you're typing into (e.g. xed or LibreOffice Writer).

Art
  • 11
  • Welcome to the community and thanks a lot! I will try it out and I will reply again, if it doesn't work – NeStack Jul 11 '23 at 20:41