/jome

An emoji picker desktop application

Primary LanguageC++MIT LicenseMIT

jome 😏

jome (johΒ·mee) is a ⌨️ centric emoji picker πŸ–₯ application.

You can also pick an emoji with the πŸ–±, don’t worry.

jome has most of the interesting emojis of Emoji 14.0.

I’m not a fan of the usual very broad categories of emojis which do not intersect so I made my own categories. A given emoji can be found in more than 1️⃣ category. For example, 🦈 is found in both the animals (no faces) and water categories. I find that it’s easier to πŸ” by theme than by very general category. Feel πŸ†“ to suggest more categories.

jome is currently only tested on 🐧.

Preview

all
palm
wom
wom fact
transp cat
transp cat car
transp cat car lig

πŸ—

You need:

  • CMake β‰₯ 3.1.0

  • A C++14 compiler

  • Boost β‰₯ 1.58 (only to πŸ—)

  • Qt 5 (Core, GUI, Widgets, and Network modules)

πŸ— jome
$ mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=release .. && make -j$(nproc)
Note
You need to install jome for it to find the correct data πŸ“„. If you don’t want to install it on your system, use -DCMAKE_INSTALL_PREFIX=path/to/install/directory when you run cmake.
Install jome
$ sudo make install

Install on Arch Linux

To install on Arch Linux from the jome-git AUR package:

$ yay -Sy jome-git

Usage

jome’s purpose is to help you pick an emoji.

When you accept an emoji (with the ⌨️ or with the πŸ–±), jome πŸ–¨ the UTF-8 emoji or the Unicode codepoints (see the -f option), with an optional prefix (see the -p option) for each codepoint, to the standard output. Additionally, jome can:

  • Copy the UTF-8 emoji or the Unicode codepoints to the clipboard. See the -b option.

  • Execute a custom command which receives the UTF-8 emoji or the Unicode codepoints, with an optional prefix for each codepoint, as its last argument(s). See the -c option.

  • Send the UTF-8 emoji or the Unicode codepoints, with an optional prefix for each codepoint, in response to a client which requested picking an emoji. See the -s option.

If you close the πŸͺŸ (you can πŸ‘‡ Escape to do this), then jome πŸ–¨ nothing to the standard output and executes nothing.

If you don’t start jome in server mode (-s option) and you don’t specify the -q option, then jome immediately quits after you accept an emoji or close the πŸͺŸ.

Graphical interface

all

There are 4️⃣ sections:

πŸ” box (⬆️)

Input box where you can ⌨️ a query to πŸ” emojis.

Emojis

All emojis (with an empty πŸ” box) or πŸ” results.

When there’s at least 1️⃣ emoji, there’s always a selected emoji with a πŸ”΄ box around it.

πŸ–± an emoji to accept it.

Hover an emoji to update the ⬇️ emoji info text temporarily.

Use the -d option to make the background behind emojis dark.

Category list

List of available categories.

When all emojis are πŸ‘ (the πŸ” box is empty), πŸ–± a category name to scroll to this emoji category.

The first category, Recent, is a special category with the recently accepted emojis.

Emoji info text (⬇️)

Name, Unicode codepoints, and Emoji version of the selected or hovered emoji.

πŸ” emojis

The power of jome is its πŸ” box.

When you launch jome, the πŸ” box is focused, and it should stay focused unless you browse emojis manually with the intention of accepting one with the πŸ–±.

The format of a query is 1️⃣ of:

  • TERMS

  • CAT/

  • CAT/TERMS

where:

CAT

Partial name of categories in which to πŸ”.

TERMS

Space-separated list of πŸ” terms.

For an emoji to be part of the results, at least 1️⃣ of its keywords must contain all the πŸ” terms.

Select and accept an emoji

To select an emoji, use the following ⌨️:

⬅️, ➑️, ⬆️, ⬇️

Go ⬅️/➑️/⬆️/⬇️.

Ctrl+⬅️, Ctrl+➑️

Go ⬅️/➑️ 5️⃣ emojis.

Page ⬆️, Page ⬇️

Go ⬆️/⬇️ 10 rows.

Home

Go to the first emoji.

End

Go to the last emoji.

To accept the selected emoji, πŸ‘‡:

Enter

Accept the selected emoji with the default skin tone (if applicable).

F1, F2, F3, F4, F5

If the selected emoji supports skin tones, accept the selected emoji with a light, medium-light, medium, medium-dark, or dark skin tone.

To cancel, πŸ‘‡ Escape or close the πŸͺŸ.

Go to Emojipedia page

To go to the Emojipedia πŸ“ƒ of the selected emoji, πŸ‘‡ F12.

To go to the Emojipedia πŸ“ƒ of any emoji with the πŸ–±, right-click it and click β€œGo to Emojipedia page”.

Command-line options

-f FMT

Set the output format to FMT:

utf-8 (default)

UTF-8 emoji.

cp

Space-separated Unicode codepoints (hexadecimal).

Example: 1f645 200d 2642 fe0f

-p PREFIX

Set the prefix to be prepended to each Unicode codepoint.

For example, with -f cp and -p U+: U+1f645 U+200d U+2642 U+fe0f.

-n

Do not πŸ–¨ a newline after πŸ–¨ the emoji or codepoints.

-c CMD

When you accept an emoji, execute command CMD 20 ms after closing the jome πŸͺŸ.

jome interprets CMD like a 🐚 does, so you can have arguments too.

CMD receives the UTF-8 emoji or the Unicode codepoints (depending on the -f option) with their optional prefix as its last argument(s).

Examples with xdotool:

$ jome -c 'xdotool type'
$ jome -f cp -p U -c 'xdotool key --delay 20'
-b

When you accept an emoji, copy the UTF-8 emoji or the Unicode codepoints (depending on the -f option) to the πŸ“‹.

-q

Do not quit when you accept an emoji.

By default, when you accept an emoji (with the ⌨️ or with the πŸ–±), jome:

  1. πŸ–¨ the accepted emoji or its codepoints to the standard output.

  2. Hides its πŸͺŸ.

  3. Optional: Copies the accepted emoji/codepoints to the clipboard (see the -b option).

  4. Optional: Executes a command (see the -c option) after 20 ms.

  5. If not running in server mode, quits (see the -s option).

With the -q option, jome does not hide its πŸͺŸ and does not quit when you accept an emoji so that you can make it πŸ–¨ multiple emojis and/or execute a command multiple ⏲ with multiple emojis without restarting the application.

You cannot specify the -q and -s options at the same ⏲.

-s NAME

Start jome in server mode and set the server name to NAME.

On Unix, this creates the socket πŸ“„ /tmp/NAME which must not exist before you start jome.

You cannot specify the -s and -q options at the same ⏲.

-d

Use a dark background for emojis.

-w WIDTH

Set the width of individual emojis to WIDTH pixels, amongst 16, 24, 32 (default), 40, or 48.

Server mode

jome features a server mode to avoid creating a process (a Qt πŸͺŸ can be quite long to create) every ⏲ you need to pick an emoji. With this mode, you can πŸ‘ the jome πŸͺŸ instantaneously.

To start jome in server mode, use the -s option to specify the server name:

$ jome -s mein-server

This creates a local server named mein-server. On Unix, it creates the socket πŸ“„ /tmp/mein-server.

Important

On Unix, the server mode won’t work if the socket πŸ“„ already exists. Remove the πŸ“„ before you start jome in server mode:

$ rm -f /tmp/mein-server
$ jome -s mein-server

When jome starts in server mode, it does not πŸ‘ its πŸͺŸ. Instead, it βŒ› for a command sent by the client, jome-ctl. To πŸ‘ the πŸͺŸ:

$ jome-ctl mein-server

When you accept an emoji, jome-ctl πŸ–¨ what jome also πŸ–¨ to the standard output and quits with exit code 0️⃣. Therefore, the output format of jome-ctl is πŸŽ› by the options passed to jome.

If you cancel jome (press Escape or close the πŸͺŸ), jome-ctl πŸ–¨ nothing and returns with exit code 1️⃣.

In server mode, jome does not quit once you accept an emoji or cancel: it hides the πŸͺŸ and keeps πŸ‘‚. To make it quit gracefully, which also removes the socket πŸ“„:

$ jome-ctl mein-server quit

You don’t need to use what jome-ctl πŸ–¨ to the standard output. You can use jome in server mode with the -c option to make jome execute a command itself. For example:

$ rm -f mein-server
$ jome -s mein-server -c 'xdotool type'

Then, bind a ⌨️ shortcut to:

$ jome-ctl mein-server

⌨️ the accepted emoji

Here are Bash πŸ“œ to ⌨️ the accepted emoji with xdotool.

Non server mode

With xdotool key
#!/usr/bin/bash

codepoints="$(jome -f cp -p U)"

if [ $? -ne 0 ]; then
    exit 1
fi

xdotool key --delay 20 $codepoints
With xdotool type
#!/usr/bin/bash

emoji="$(jome)"

if [ $? -ne 0 ]; then
    exit 1
fi

xdotool type "$emoji"

Server mode

With xdotool key
#!/usr/bin/bash

socket_name="jome.socket.$(id -u)"

if ! pidof jome &>/dev/null; then
    rm -f "/tmp/$socket_name"
    jome -s "$socket_name" -f cp -p U -c 'xdotool key --delay 20' & disown

    while [ ! -e "/tmp/$socket_name" ]; do
        sleep .1
    done
fi

jome-ctl "$socket_name"
With xdotool type
#!/usr/bin/bash

socket_name="jome.socket.$(id -u)"

if ! pidof jome &>/dev/null; then
    rm -f "/tmp/$socket_name"
    jome -s "$socket_name" -c 'xdotool type' & disown

    while [ ! -e "/tmp/$socket_name" ]; do
        sleep .1
    done
fi

jome-ctl "$socket_name"