Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Emoji picker that remembers your favorites, with support for bemenu/wofi/rofi/dmenu and wayland/X11.

License

NotificationsYou must be signed in to change notification settings

marty-oehme/bemoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

status-badge

bemoji picker interface on bemenu

Emoji picker with support for bemenu/wofi/rofi/dmenu and wayland/X11.

Will remember your favorite emojis and give you quick access.

📁 Installation

Dependencies

  • One ofbemenu,wofi,rofi,dmenu,ilia,fuzzel or supplying your own picker.
  • One ofwl-copy,xclip,xsel or supplying your own clipboard tool.
  • One ofwtype,xdotool or supplying your own typing tool.
  • sed,grep,cut,sort,uniq,tr,curl if using the download functionality.

To see how to substitute the default choices with your own tools,see Options below.

rofi picker interface

Manual

Option 1. Clone the repository and put the executable somewhere in your path:

git clone<INSERT-REPOSITORY>chmod +x bemoji/bemojimv bemoji/bemoji /usr/local/bin/bemojirm -r bemoji

Option 2. Clone the repository and link the executable to your path:

git clone<INSERT-REPOSITORY>chmod +x bemoji/bemojiln -s bemoji/bemoji /usr/local/bin/bemoji

Arch Linux

On Arch Linux, bemoji has been packaged for theAUR so it can be installed manually from here or easily with your preferred AUR helper, e.g.:

paru -S bemoji# or bemoji-git

💿 Usage

wofi picker interface

Simply executebemoji without any options to set up the default emoji database and let you quickly pick an emoji.It will be copied to your clipboard for you to paste anywhere.If you executebemoji -t it will directly type your emoji directly into whatever application is in focus.

When the emoji list is open you can always pressAlt+1 to send the selected emoji to clipboard andAlt+2 to type the selected emoji,regardless of what the default action is set to.(Currently works in bemenu and rofi.)

You can also map the picker to a key combination for quick access, e.g.

Inswaywm, put the following in~/.config/sway/config:

bindsym Mod4+Shift+e exec bemoji -t

Fori3, put the same into~/.config/i3/config:

bindsym Mod4+Shift+e exec bemoji -t

Forriverwm, put the following in~/.config/river/init:

riverctl map normal Mod4+Shift E spawn "bemoji -t"

Insxhkd, put the following into~/.config/sxhkd/sxhkdrc:

super + Shift + e    bemoji -t

And you can easily type any emoji with the help ofSuper+Shift+E.

🧰 Options

bemoji help window

bemoji comes with a couple of options to specify actions, emoji libraries and directories being used.

Adding your own emoji

Simply put your own emoji list into the bemoji data directory.By default, the directory will be at your$XDG_DATA_HOME/bemoji location -most likely this is~/.local/share/bemoji.

Add any number of.txt files containing additional emoji to this directory:

🫦 Biting lip🫶 Heart Hands

The listsneed to have the format🙂 description of emoji with a whitespace separating the emoji and its description.The description can have as many words and whitespaces as you want.

Ignoring the most recent emoji

By default, bemoji will sort the list it displays by your most frequently and most recently used emoji.To disable this behavior, execute bemoji like the following:

bemoji --hist-limit 0

This will stop bemoji from adding recently used emoji before displaying the list.

You can also stop bemoji from adding any emoji to your history in the first place:

bemoji --private

This will not add any of the emoji you pick to your recent emojis.Put both together to completely ignore the recent emoji feature of the program(these are the equivalent short versions of the options above):

bemoji -p -P0

Like this, you'll be hiding any recent personal emoji and keep any new ones you use out of your history.

To limit the number of your recently used emoji that are shown without hiding them completely simply increase the number to however many you wish to display.For example, to display only the top 4 recently used emoji:

bemoji --hist-limit 4

The recent list will also contain emoji that arenot usually on your lists,so kept in single-use lists for example.If you don't wish those to show up, make use of these options.

Setting custom directories and editing history

By default bemoji stores your recent history in$XDG_STATE_HOME/bemoji-history.txt,so most often in~/.local/state/bemoji-history.txt

You can edit this file in any text editor to change your recent history,removing, adding or changing the emoji appearing there.

You can overwrite the directories bemoji uses for its emoji lists and history files with the following two environment variables:

BEMOJI_DB_LOCATION=/path/to/my/emoji/directoryBEMOJI_HISTORY_LOCATION=/path/to/my/state/directory

There are no equivalent commandline arguments to overwrite these two settings.

Display one custom emoji list

A custom emoji list can be supplied as commandline argument-f orBEMOJI_CUSTOM_LIST environment variable.

bemoji --file path/to/my/list.txt

The list will override the normally presented emoji,so that only the custom list and recent emoji will be displayed.To displayonly the emoji list passed in, pass an extra-P flag to bemoji.

The path can also be a weblink which bemoji will download and use:

bemoji -f"https://raw.githubusercontent.com/jchook/emoji-menu/master/data/emojis.txt"

Download additional emoji sets

bemoji automatically downloads an emoji list for you to use on first invocation.By default, it only downloads emoji, though you can have it download math symbols and nerdfont icons as well.To download additional sets, execute bemoji like the following:

bemoji --download all

This will downloadall default sets bemoji knows - which is currently the default emoji list, nerd font icons, and a long list of math symbols.Other valid options for this setting areemoji,math,nerd,none.

bemoji -D"math emoji nerd"

The above command is equivalent to the previousall as you can mention multiple sets you want downloaded.

If set tonone and no files are in the emoji directory,bemoji will complain and not show anything.

Do not skip to new line after output

By default, bemoji will craft the final output using a typicalecho call for anything it prints directly.

That means, it will also contain a final newline character.So, for example it would technically output🦊\n for thefox emoji,which skips to a new line in most circumstances.

If you wish to prevent this character in the final output, use:

bemoji -n

Using this option will suppress the newline character andonly print🦊 as its output.

Using a custom tool for picking, clipping, typing

If you want to replace one of the default supported tools with your own you can do this through environment variables:

BEMOJI_PICKER_CMD="path/to/your/picker-tool"BEMOJI_CLIP_CMD="path/to/your/clipboard/tool"BEMOJI_TYPE_CMD="path/to/your/xdotool"

The candidate list (in the case of picker tool) or the picked selection are passed to the tools through stdin.

For example, to manually invoke fuzzel with no extra options as the picker for bemoji you would use:

BEMOJI_PICKER_CMD="fuzzel -d" bemoji

This is somewhat experimental still and you'll have to see how well it works for you.The setting can not be changed through the commandline alone.

Execute a custom command with my emoji

You can execute bemoji with the-e flag with which you tell it not to do anything but echo out the chosen emoji.

This can be very useful for creating your own little script with it:

bemoji --echo| cat<(echo -n"https://emojipedia.org/") -| xargs xdg-open

This snippet will open a wiki page for the picked emoji in your browser.

Of course, there are many more possibilities.This is just an example to show how the echo mode works.

A list of all environment variables

What follows is a list of all environment variables bemoji understands,with their default settings

DescriptionCommandline optionenvdefault
enable/disable newline-n, --nolineBEMOJI_ECHO_NEWLINEtrue
enable private mode-p,--privateBEMOJI_PRIVATE_MODEfalse
limit history items-P,--hist-limitBEMOJI_LIMIT_RECENT
download specific emoji lists-D,--downloadBEMOJI_DOWNLOAD_LIST
read emoji from file-f,--fileBEMOJI_CUSTOM_LIST
emoji lists directoryBEMOJI_DB_LOCATION$XDG_DATA_HOME/bemoji
emoji history directoryBEMOJI_HISTORY_LOCATION$XDG_STATE_HOME
custom default commandBEMOJI_DEFAULT_CMD
custom type commandBEMOJI_TYPE_CMD
custom pick commandBEMOJI_PICKER_CMD
custom clip commandBEMOJI_CLIP_CMD

The environment variables have the following effects:

BEMOJI_DB_LOCATION="$XDG_DATA_HOME/bemoji"# where the emoji lists resideBEMOJI_HISTORY_LOCATION="$XDG_STATE_HOME"# where the state file residesBEMOJI_CUSTOM_LIST=""# the custom emoji list to displayBEMOJI_DOWNLOAD_LIST=""# the default emoji lists to download to databaseBEMOJI_DEFAULT_COMMAND=""# which command to invoke by defaultBEMOJI_PICKER_CMD="bemenu"# which picker tool to useBEMOJI_CLIP_CMD="wl-copy"# which clipboard tool to useBEMOJI_TYPE_CMD="wtype"# which typing tool to use (ydotool will NOT work)BEMOJI_PRIVATE_MODE=false# whether to save new entriesBEMOJI_LIMIT_RECENT=""# whether to display recent entriesBEMOJI_ECHO_NEWLINE=true# whether to end the output with a newline character

They can either be set likeexport BEMOJI_LIMIT_RECENT=5 before executingbemoji and willremain in the shell environment.Or they can be set for just a single run ofbemoji like this:

BEMOJI_ECHO_NEWLINE=true BEMOJI_PRIVATE_MODE=true bemoji

This is especially useful for advanced configurations like custom commands which do not have anequivalent option to be set. Be careful with setting environment variables as setting them wrongor forgetting about them can have detrimental impacts on the functionality of this program!

🤗 Issues

Thanks for checking this program out! ❤

If there are any problems, don't hesitate to open an issue.

If you have an idea or improvement, don't hesitate to open a merge request!

Known issues

There is a known issue concerning some GUI application which do not receive the correct emojiswhen auto-typing and instead a bunch of empty unicode squares.It seems to be an issue withwtype and may need to be fixed upstream.

Unfortunately,wtype is the only stable wayland typing backend to my current knowledge.Untilbemoji supports more typing backends on wayland, a workaround seems to be to save theemoji to the clipboard and have a typing tool paste the contents of the clipboard directly,like the following:

bemoji -cn&&echo key ctrl+v| dotool

The issue is tracked at#34.

Running tests

This project makes use ofbash-bats (community fork) to test some of its functionality.

To run the tests locally:

git submodule initgit submodule update./test/bats/bin/batstest

I would suggest running the test suite in docker instead, just to minimize the possibility of something going awry and borking up your local file system.To run the tests in a docker suite, executedocker run --rm -it -v "$PWD:/code" bats/bats:latest /code/test after initializing the git submodules as listed above.

About

Emoji picker that remembers your favorites, with support for bemenu/wofi/rofi/dmenu and wayland/X11.

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp