A simple emoji picker for rofi with multi-selection
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.


1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
  1. # A fork of Rofimoji (an emoji picker for rofi) with unicode search
  2. This repository is a fork of [rofimoji by fdw](https://github.com/fdw/rofimoji) with the addition of unicode characters from [/u/fe80c0ffee](https://www.reddit.com/r/unixporn/comments/7zqkov/oc_i_mad_a_rofi_emoji_picker_and_i_feel_bad_about/duqls53?utm_source=share&utm_medium=web2x). Unicode characters are sorted to be shown first when invoking Rofimoji. A .txt file with Awesome font from [/u/Delearyus](https://www.reddit.com/r/unixporn/comments/7zqkov/oc_i_mad_a_rofi_emoji_picker_and_i_feel_bad_about/duvrlla?utm_source=share&utm_medium=web2x) is supplied too, but not included by default; one can just copy/paste its content into `rofimoji.py` between `emoji_list = """` and `"""`.
  3. Recommended command line to run Rofimoji from a keybinding:
  4. ```bash
  5. python3 /path/to/rofimoji/rofimoji.py -s ask --rofi-args="-columns 3; -width 50%; -no-click-to-exit; -theme sidebar"
  6. ```
  7. ## Original README.MD:
  8. How often did you want to insert one of those Unicode emoji only to learn that there is no nice picker for Linux?
  9. Fear no more, this script uses the power of [rofi](https://github.com/DaveDavenport/rofi/) to present exactly the picker you always wanted.
  10. Inserts the selected emoji directly, or copies it to the clipboard.
  11. ## Usage
  12. 1. Run `rofimoji.py`
  13. 2. Search for the emoji you want
  14. 3. (optional) Select multiple emoji with `shift+enter`
  15. 4. Hit `enter` to insert the emoji directly \
  16. Hit `alt+c` to copy it to the clipboard \
  17. `alt+t` or `alt+p` can be used to select a specific input method
  18. 5. Maybe select a skin color
  19. 6. 🎠
  20. ## How does it look?
  21. ![Screenshot of rofimoji](screenshot.png?raw=true)
  22. ## Insertion method
  23. For some applications, `xdotool` cannot type emojis (f.e. Firefox). 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.
  24. 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 😐.
  25. By default, `rofimoji` uses `xdotool type`. To choose to spam your clipboards, you can either use the keybinding `alt+p` or start it as `rofimoji --use-clipboard` (`-c`). If you want to use typing, you can hit `alt+t`, even though it was started with `--use-clipboard`.
  26. ## Configuration
  27. You can choose a skin tone with the `--skin-tone` (or `-s`) parameter. The available values are `light`, `medium-light`, `moderate`, `dark brown`, `black`, as well as `neutral` and `ask` to be shown the prompt (this is also the default).
  28. If you have any arguments for rofi, you can make `rofimoji` pass them through like this: `rofimoji --rofi-args="-columns 3"`.
  29. You can also define your own set of emojis (or whatever) and use `rofimoji` to pick them by providing the `--emoji-file` (`-f`) parameter. This could be helpful if you want them ordered in some way, only use a subset or if you want non-English descriptions.
  30. ## Installation
  31. ### Arch
  32. A kind soul has packaged it as [rofimoji](https://www.archlinux.org/packages/community/any/rofimoji/). To, install, use `sudo pacman -Syu rofimoji`.
  33. ### From sources
  34. Download `rofimoji.py` and move it somewhere on your path, for example `/usr/local/bin`.
  35. What else do you need:
  36. - Python 3
  37. - A font that can display emoji, for example [EmojiOne](https://github.com/emojione/emojione) or [Noto Emoji](https://www.google.com/get/noto/)
  38. - xdotool for typing the emoji
  39. - xsel to copy the emoji to the clipboard
  40. For Ubuntu zesty: `sudo aptitude install fonts-emojione python3 rofi xdotool xsel` \
  41. For Arch: `sudo pacman -Syu emoji-font python rofi xdotool xsel`
  42. ## Updating the emojis
  43. This is only needed if a new Unicode version came out and you can't wait for the official update!
  44. 1. Install Python 3 and `pip install -r requirements-dev.txt`
  45. 2. Run `extract_emojis.py` - this downloads the complete list from https://unicode.org/emoji/charts-12.0/full-emoji-list.html, so don't do it too often!
  46. 3. A new file `emojis.py` should have been created. Open it and copy the contents
  47. 4. Open `rofimoji.py` and replace the emoji list with the contents of `emojis.py`
  48. ## FAQ
  49. ### Why is it so pedestrian? Why not simply import from `emojis.py`?
  50. Because now you only have to download one file, and it works 
  51. Additionally, we need no separate I/O just to load the emojis. This is good, right?