Giter VIP home page Giter VIP logo

jome's Introduction

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"

jome's People

Contributors

coolreader18 avatar eepp avatar toxicmushroom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jome's Issues

Cancel Key-Binding

Hey!

Currently you have selected ESC for closing the emoji chooser.
However, it would be really nice to have this as a variable.

Maybe you may take rofi as an inspiring example.
rofi -show drun -kb-cancel Super_L

CTRL+C to cancel the dialog would also be viable.

Regards and cool tool!

Optionally sort emojis by most recently used when searching

When I search using some keyword(s), I generally want the same emoji as the last time I searched the same keyword(s).

I suggest adding a command-line option to enable a new mode where, when you search, the results are sorted by most recently used (selected).

For this, jome needs to assign a most recently used index to each emoji and keep it.

Default emoji font

It's possible to change default emoji font? I have apple emoji font and i want to see it in emoji picker

[Arch jome-git] `$ jome-ctl serverName` doesn't do anything

I run a server in a terminal like this:
jome -s server
and try to open an emoji picker using
jome-ctl server

Using just jome opens the window but this is slower ofcourse.
Perhaps this is a side effect from having had jome installed manually before.

Build fails

Hi, I tried to build jome according to instructions, but it fails with one error.

  • cmake 3.23.2
  • gcc 12.1.0
  • boost 1.79.0
❯ cmake .. -DCMAKE_BUILD_TYPE=release
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/lib64/cmake/Boost-1.79.0/BoostConfig.cmake (found suitable version "1.79.0", minimum required is "1.58")  
-- Configuring done
-- Generating done
❯ make
[ 10%] Building CXX object jome/CMakeFiles/jome.dir/jome.cpp.o
jome/jome.cpp: In function ‘std::string {anonymous}::formatEmoji(const jome::Emoji&, const boost::optional<jome::Emoji::SkinTone>&, Format, const std::string&, bool)’:
jome/jome.cpp:168:34: error: aggregate ‘std::array<char, 32> buf’ has incomplete type and cannot be defined
  168 |             std::array<char, 32> buf;
      |                                  ^~~

Can't paste into firefox

Hi, this is probably not something you can fix, but just in case you knew a workaround - the xdotool examples do not work for me with firefox, at all. Nothing is pasted.

I discovered it works great in

  • Chrome, Sublime Text, Gnumeric, Libre Office, Gedit, gitk

doesn't work in:

  • KWrite, Kate, Firefox, Konqueror

so maybe it works in GTK and Tcl/Tk apps and not in Qt apps? but I'm not sure. Thanks for any ideas

Minor Improvements

First off, great job on this Emoji picker 🚀. With a bit of setting up it's by far the best one I've been able to find for Linux.

That being said, it would be great to see some minor improvements:

  1. Application Icon - At the moment it's just using a default Xorg icon.

    image

  2. In the documentation you advise using xdotool key to print the emoji to the current window. However, I ran into a lot of trouble with xdotool key "holding down" the key for too long and outputting multiple emojis. Though undoubtedly an xdotool bug and not a jome bug, I found that simply doing jome -c 'xdotool type' works much better and achieves the same result as jome -f cp -p U -c 'xdotool key --delay 20' without any of the repeating key issues.

  3. The last issue I had was with emojis not being sent to the window properly without adding a long delay to the command. This seems to be due to the jome window not closing quickly enough sometimes and reverting focus to the previously active window. My solution is to instead use a set of shell scripts to explicitly focus the previous window.

    jome-show.sh
    
    #!/bin/sh
    jome -c "jome-print.sh $(xdotool getactivewindow)"
    jome-print.sh
    
    #!/bin/sh
    xdotool windowfocus $1
    xdotool type $2

    This can of course be adapted for server mode too.

  4. I'm not sure if it's even possible, but it would be super cool if there was a way to print multiple emojis to a window without needing to re-open jome each time.

Anyway, thanks again for making jome and keep up the good work!

Segfault when client is killed and window closed

I think this is missing some debug symbols, but it should be easy to reproduce anyway

Thread 1 "jome" received signal SIGSEGV, Segmentation fault.
0x00007ffff717a7a0 in QLocalSocket::state() const () from /usr/lib/libQt5Network.so.5
(gdb) bt
#0  0x00007ffff717a7a0 in QLocalSocket::state() const () from /usr/lib/libQt5Network.so.5
#1  0x00005555555762d6 in jome::QJomeServer::sendToClient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#2  0x000055555556cdc2 in QtPrivate::QFunctorSlotObject<main::{lambda()#1}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) ()
#3  0x00007ffff6e26dd6 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007ffff7a7ab0e in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#5  0x00007ffff7a39752 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#6  0x00007ffff6defa7a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#7  0x00007ffff7a75c66 in QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) () from /usr/lib/libQt5Widgets.so.5
#8  0x00007ffff7a9679e in ?? () from /usr/lib/libQt5Widgets.so.5
#9  0x00007ffff7a39752 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#10 0x00007ffff6defa7a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#11 0x00007ffff734812f in QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent*) () from /usr/lib/libQt5Gui.so.5
#12 0x00007ffff7320bb5 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#13 0x00007ffff2fc816c in ?? () from /usr/lib/libQt5XcbQpa.so.5
#14 0x00007ffff58928f4 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#15 0x00007ffff58e6821 in ?? () from /usr/lib/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#16 0x00007ffff5891121 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#17 0x00007ffff6e486e1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#18 0x00007ffff6dee3fc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#19 0x00007ffff6df6894 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#20 0x000055555556b05c in main ()

Steps:

  1. Start server
  2. Connect with the client
  3. Kill client by ctrl+C
  4. Close the open window
  5. profit

Server-mode window opens unfocused in background (KDE)

The server window opened by jome-ctl opens unfocused in background when KWin "focus stealing prevention" is anything above "None". I normally use "Medium".

If possible, could the server request focus after the window is shown?

Here is a workaround that seems to work:

#!/usr/bin/bash

activateit(){
  sleep 0.05
  xdotool windowactivate $(xdotool search --class "jome")
}

activateit &

emoji="$(jome-ctl jome.sock)"
echo "Selected: $emoji"

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

echo -n "$emoji" | xclip -selection clipboard
echo -n "$emoji" | xclip -selection primary
echo -n "$emoji" | xclip -selection secondary

xdotool key --clearmodifiers shift+Insert

Update to Emoji version 14.0 or 15.0

Would it be possible to update the emoji list to include the newly added 14.0 or even 15.0 emojis to the project?

Also kinda (offtopic but felt wasteful to make another issue for it.) is it known that jack-o-lantern isn't in the list even tho it's been an emoji since Emoji v1 ?

Have user-defined categories and keywords

I believe the project should install basic category and keyword JSON files, perhaps the official Unicode ones.

Then, the user could provide its own categories and keywords in JSON files found in ~/.config/jome.

I still don't know how the user could control whether to override or augment the defaults of the project.

Making it more user friendly

Hello,
I just tried out jome, I must say it looks great!
I was looking for a newer replacement to this https://github.com/edam/emoji-keyboard, but jome looks more like a tool or a serverside thing.

I would love to have an icon for it in my taskbar and automatically type the emoji where my focus is.
I know I could do this myself but do you think this would be a great addition to have this option 'out of the box'?

Thanks

Error installing from aur

Could you please have a look at this error
image

Also, please update any python dependencies to python3, python2 is running out life soon, 2020 or 2022 I think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.