1. Introduction

Linux offers different ways to use embedded emojis along with the text.

In this tutorial, we’ll explore various ways to insert an emoji when using Ubuntu and the GNOME desktop environment.

First, we’ll discuss the GNOME Characters application. Following that, we turn to the GNOME Emoji Selector extension. After that, we’ll insert emojis using the Ubuntu terminal and Unicode. Lastly, we’ll look at the use of emojis via the emoji keyboard.

2. Using the GNOME Characters

The first approach we’ll learn to use emojis in text is the GNOME Characters application. It provides emojis and related characters by category organized in a basic interface.

Since it may not be available by default on Ubuntu, we’ll install GNOME Characters using apt:

$ sudo apt install gnome-characters

Once the installation is complete, we’ll open the Characters application:

  1. Click the Activities button in the bottom left corner or open the Activities panel
  2. Type Characters in the search bar
  3. Press Return

Now, we can view all the emoji characters:

view all the emoji characters

To insert the character into a text, we click on the character to open a dialogue box. After that, we click the Copy Character button:

copy emoji from Characters

Lastly, we can paste the character:

insert emoji in text

This way, we can add emojis to any text field or terminal.

3. Using the Emoji Picker

One approach to using emoji in a text editor is the Emoji Picker extension. After the Ubuntu 18.04 LTS release, we can employ this method within GTK text editors. In addition, this emoji selector is also a part of the GNOME environment.

For this method, we open the gedit text editor and right-click within the text field:

right-click the blank area

After that, we click Insert Emoji from the context menu. Consequently, we get the pop-up from which we can choose any emoji:

insert emoji directly in the text editor

On top of the simple selection, the extension offers a range of useful functions:

  • search for emoji by name
  • browse emoji by category
  • pick a recently used emoji
  • add emoji with a click

However, the Emoji Picker extension wouldn’t work on non-GTK applications such as LibreOffice or Firefox.

4. Using the Terminal

Of course, one way to insert emojis into a text file is to use the terminal. For this approach, we use a command like echo or printf:

$ echo -e '\U1F604'

In the above code, we use the -e option with echo to enable the interpretation of escape sequences. In addition, we add the Unicode character for the emoji we want to insert.

By redirecting the output of this command, we can add the emoji combined with text:

$ echo -e "Hello World \U1F604" >> emoji_text.txt

Lastly, let’s view the resulting file using the cat command:

$ cat emoji_text.txt
Hello World 🙂

Thus, we can insert emojis into a text via the Ubuntu terminal and escape sequences as long as we know the exact code of the emoji.

5. Using the Emoji Keyboard

We can also set up an emoji keyboard to type emojis seamlessly. This approach is usually quicker, easier, and more convenient to use when compared to previously discussed approaches. However, it takes more time to set up.

In addition, the emoji keyboard, uniemoji, works in all text editors and applications, including LibreOffice.

5.1. Set up ibus and uniemoji

First, we’ll install the IBus framework for the emoji keyboard:

$ sudo apt install ibus

ibus has different modules for different languages. For emoticons, we’ll work with uniemoji.

Then, we’ll add the universe repository to our system’s list of packages and update the system packages:

$ sudo add-apt-repository universe && sudo apt update

Next, we’ll install two packages, git and make:

$ sudo apt install git make

After that, we’ll fetch the uniemoji repository:

$ git clone https://github.com/salty-horse/ibus-uniemoji.git

Next, we’ll switch the directory using the cd command, and compile the software from the ibus-uniemoji project:

$ cd ibus-uniemoji
$ sudo make install

Lastly, we’ll restart the ibus service:

$ ibus restart

Once we’ve restarted the ibus service, we’ll also restart the system to ensure that the ibus-uniemoji is fully integrated.

5.2. Enable and Use uniemoji

Now that we’ve set up the ibus framework, we need to integrate the uniemoji package into the system. For this step, we’ll open Settings from the terminal:

$ gnome-control-center

This opens Settings. Now, we’ll add uniemoji:

  1. Go to Keyboard
  2. Locate Input Sources
  3. Click + to add more languages
  4. Other > Other (uniemoji) > Add:
add uniemoji keyboard

Finally, we can insert emojis in any text field and terminal:

add emoji in text

Crucially, we’ll have to switch the keyboard by pressing the Command or Windows + Space keys.

6. Conclusion

In this article, we discussed various ways to insert emojis into a text in Ubuntu.

First, we discussed GNOME Characters to insert emojis. After that, we saw how to add emojis using the Emoji Picker. We also looked at using the Ubuntu terminal to add emojis to files. Lastly, we set up the emoji keyboard to seamlessly insert the emojis.

Comments are open for 30 days after publishing a post. For any issues past this date, use the Contact form on the site.