Hacker News new | ask | show | jobs
by yoavm 685 days ago
I just have this one liner for Wayland:

  cat ~/.local/share/emojis/emojis| wofi -i -d -M fuzzy -H 700 | cut -d " " -f 1 | tr -d '\040\011\012\015' | wtype -
It shows an overlay fuzzy-searchable list of all emojis, and it writes selected one to the input regardless of the toolkit. assign it to a keyboard shortcut and you're good to go.

the ~/.local/share/emojis/emojis file is just a list of all emojis:

  cat ~/.local/share/emojis/emojis | head -n 3
         Grinning Face
         Grinning Face with Big Eyes
         Grinning Face with Smiling Eyes
(HN is removing the emojis but each line starts with the emoji self, followed by the description)
3 comments

I use rofi-emoji [0] on X11, and it's great.

[0]: https://github.com/Mange/rofi-emoji

Ha, I've been using a very similar tool for years, both for emojis but also for math characters:

https://github.com/fdw/rofimoji

Note input is "out of scope" for wayland and XKB is used there for keyboard input as well. I just had a quick glance at "wtype" source and indeed, it fiddles with the keymap, using xkbcommon. So, assuming a suitable X11 replacement for this "wofi" tool, you could do exactly the same on X11 using "xdotool".
Indeed nothing special about Wayland for this, I have used `xdotool` in the old X11 days.
And where can one obtain this `emojis` file?
You know, we should add an emojis dictionary to http://wordlist.aspell.net/ for exactly this purpose. Why not have a /usr/share/dict/emoji just like we have /usr/share/dict/words?