How to have text expansion in Fedora with Wayland?

The expansion of ty to thank you under both X and Wayland can be accomplished with the following steps:

Enable more than one IBus engines “Input Sources” by going into Settings > Region & Language ( gnome-control-center region), as explained in the IBus 1.5.21 release announcement (October 2019).

Designate a Compose Key of your choice by going into Settings > Keyboard Shortcuts (gnome-control-center keyboard) and clicking Alternate Characters Key.

Create a file ~/.XCompose with the following contents:

<Multi_key> <t> <y>                  : "thank you"

A restart of the ibus daemon is necessary to pickup any changes to your ~/.XCompose file:

$ ibus restart

Then, in an application like gedit or Gnome Terminal, type your chosen Compose Key followed by ty. You should see it expanded to thank you.

054c7d6576bdb5f21b5fbb70681ce51b0509b351.gif

For more about this approach of using the Compose key for multicharacter replacements, see this discussion at the Unix & Linux Stackexchange.

Unfortunately, this Compose Key approach won’t work for dynamic content like entering the current date. I’d love to see an ibus-based mechanism with support for dynamic content. I heard that the ibus-libpinyin input method has this ability, but I don’t wish to switch to a different language to attain this goal. In the mean time, to insert dynamic content, I create bash scripts that generate the content and pipe them to the clipboard using xclip -sel c. I execute such bash scripts using Gnome’s Alt+F2 dialog, which is made more useable with the gnome-shell-extension-historymanager-prefix-search extension.

3 Likes