How often did you want to insert one of those Unicode emoji only to learn that there is no nice picker for Linux? Fear no more, this script uses the power of rofi to present exactly the picker you always wanted. Insert the selected emoji directly, or copy it to the clipboard. And you can use it to pick any weird character someone got into Unicode, too.
- Run
rofimoji.py
- Search for the emoji you want
- (optional) Select multiple emoji with
shift+enter
- Hit
enter
to insert the emoji directly
Hitalt+c
to copy it to the clipboard
alt+t
oralt+p
can be used to select a specific input method
alt+1
inserts the most recently used character (alt+2
for the second most recently one etc.)
alt+u
inserts the Unicode codepoint,alt+i
copies it to the clipboard - Maybe select a skin color
- ๐
By default, rofimoji
types the characters using either xdotool
or wtype
(see Display server support). You can enforce this behavior with --action type
(-a type
).
For some applications (f.e. Firefox), this does not work. To work around this, rofimoji
can copy the emojis to your clipboard and insert them from there with shift+insert
. Afterwards, it will restore the previous contents.
Unfortunately, it depends on the receiving application whether shift+insert
uses the clipboard or the primary selection.
Therefore, rofimoji
uses both and also restores both.
To choose to spam your clipboards, you can either use the keybinding alt+p
or start it as rofimoji --action clipboard
(-a clipboard
).
If you want to use typing, you can hit alt+t
, even though it was started with --action clipboard
.
Finally, with --action copy
(or -a copy
) you can also tell rofimoji
to only copy the selected characters to your clipboard.
rofimoji
supports both X11 and Wayland by using either xsel
/xclip
and xdotool
on X11 or wl-copy
and wtype
on Wayland. It chooses automatically the right one for the currently running session.
If you want to manually overwrite this, have a look at the --clipboarder
and --typer
options below.
By default, rofimoji
will show the last ten recently used characters separately; you can insert them with alt+1
, alt+2
and so on. It will use the default insertion Method.
If you don't want this, you can set --max=recent
to 0
.
The characters are saved in $XDG_DATA_HOME/rofimoji/recent
.
You can configure rofimoji
either with cli arguments or with a config file called $XDG_CONFIG_HOME/rofimoji.rc
. For the file, use the long option names without double dashes.
long option | short option | possible values | description |
---|---|---|---|
--action |
-a |
type , copy , clipboard |
Chose what rofimoji should do with the selected characters. See Insertion Method.type : Directly type the characters into the last active window.copy : Copy them to the clipboard.clipboard : Insert the selected emoji through pasting from the clipboard, instead of directly typing them. |
--files |
-f |
all , <yourfile> or any of the files in data |
Define which file(s) to load characters from. You can define your own files, or use any of the default ones. If set to all , all default files are used. Use with caution, that is a lot.If no file is set, the default emoji list is used. |
--skin-tone |
-s |
light , medium-light , moderate , dark brown , black , as well as neutral and ask |
Define the skin tone of supporting emojis. ask will always ask the user. |
--max-recent |
1-10 | Show at most this many recently picked characters. The number will be capped at 10. | |
--prompt |
-r |
any string | Define the prompt text for rofimoji . |
--rofi-args |
Define arguments that rofimoji will pass through to rofi .Please note that you need to specify it as --rofi-args="<rofi-args>" or --rofi-args " <rofi-args>" because of a bug in argparse |
||
--clipboarder |
xsel , xclip , wl-copy |
Access the clipboard with this application. | |
--typer |
xdotool , wtype |
Type the characters using this application. |
~/.config/rofimoji.rc
:
action = copy
files = [emojis, hebrew]
skin-tone = moderate
You can define additional character files and load them with -f
(see options). In each line, one 'character' can be defined, followed by a single space character (
). After that, you can write whatever description you want.
If you think your file is useful to others, you can open a PR to include it in future versions of rofimoji
.
A kind soul has packaged it as rofimoji. To, install, use sudo pacman -Syu rofimoji
.
Download the wheel file from releases and install it with sudo pip install $filename
(or you can use pip install --user $filename
to only install it for the local user).
Afterwards, there should be a rofimoji
on your $path
.
This also installs the python dependency configargparse
.
What else do you need:
- Python 3.7 or higher
- A font that can display your scripts, (for emojis, EmojiOne or Noto Emoji work)
- A tool to programmatically type characters into applications. Either
xdotool
for X11 orwtype
for Wayland - A tool to copy the characters to the clipboard.
xsel
andxclip
work on X11;wl-copy
on Wayland
For Ubuntu focal: sudo aptitude install fonts-emojione python3 rofi xdotool xsel
For Arch: sudo pacman -Syu emoji-font python rofi xdotool xsel
If you really, really need to update the characters and cannot wait for the official update:
- Install Python 3 and
pip install -r requirements.txt
in theextractors
directory. - Still in the
extraactors
directory, runpython main.py
: This downloads several large lists from unicode.org, so please don't do it too often! - The data files should have been updated. You probably need to install
rofimoji
again from source.