Package: rofimoji
Rofimoji: A character picker for rofiDo you want to use one of those fancy emojis? Or one of those other interesting characters Unicode offers? But you haven't found a good picker yet?Fear no more,rofimojiinvokes the power ofrofi(and other dmenu-derivatives likewofiorfuzzel) to give you exactly the picker you always wanted.Main featuresInsert the select character directly, or copy it to the clipboard.Characters (and especially emojis) are fuzzy-searchable with keywords.It remembers the ones you use most and presents them first.Emojis by default, but you can have any Unicode block you want - you can evenuse your own!How does it look?DefaultWith agrid themeUsageStandaloneCallrofimojias a standalone tool.RunrofimojiSearch for the character you want(optional) Select multiple emoji withshift+enterHitenterto for the default action or use one of theshortcutsto do something else.alt+1directly chooses the most most recently used character (alt+2for the second most recently one etc.)Maybe select a skin color🦾As a rofi modeIntegraterofimojias just another rofi mode.Call rofi withrofi -modi "emoji:rofimoji" -show emojiSearch for the character you wantHitenterto execute your default action;Alt+Shift+1for copying to the clipboardAlt+Shift+3for the "clipboard" insertion methodalt+1inserts the most recently used character (alt+2for the second most recently one etc.)Maybe select a skin color🐉Caveats when runningrofimojias a rofi modeThere are some limitations to this approach, though:
Running as rofi mode has several drawbacks that cannot be changed:Becauserofiis the main process,rofimojicannot directly type to any window. Only copying the character works, so set the--actionaccordingly.You can only select one character at a time.The custom keyboard shortcuts are still there, but mapped toAlt+Shift+1(on a Qwerty keyboard) etc.The configuration still works as described. You can have several modes in acombifor different character sets, for example, or set a default action and skin tone.ConfigurationYou can configurerofimojieither 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.Optionslong optionshort optionpossible valuesdefault valuedescription--action-atype,copy,clipboard,unicode,copy-unicode,print,menutypeChoose whatrofimojishould do with the selected characters. SeeActionsbelow for details.--files-fall,<yourfile>orany of the files indataemojisDefine which file(s) to load characters from. A file name without extension (f.e.emojis_smileys_emotion) is enough for the distributed ones or any in${XDG_DATA_HOME}/rofimoji/data. Globbing with*is possible.allis a shortcut for all default files at once. Use with caution, that is alot.--skin-tone-slight,medium-light,moderate,dark brown,black, as well asneutralandaskaskDefine the skin tone of supporting emojis.askwill always ask the user.--max-recent0-1010Show at most this many recently picked characters. The number will be capped at 10. Set to0to disable the whole feature.--no-frecency(no-frecency=Truein the config file)-<false>By default,rofimojishows frequently used items first. With this option, they're shown in the order of the file.--hidden-descriptions(hidden-descriptions=Truein the config file)-<false>Only list the characters, but not their description. This is useful forgrid themes. Note that they're still searchable, even though the description is not shown.--prompt-rany string😀Define the prompt text forrofimoji.--selector-argsDefine arguments thatrofimojiwill pass through to the selector (rofi,wofiorfuzzel).Please note that you need to specify it as--selector-args="<selector-args>"or--selector-args " <selector-args>"because of abug in argparse--selectorrofi,wofi,fuzzel(automatically chosen)Show the selection dialog with this application.--clipboarderxsel,xclip,wl-copy(automatically chosen)Access the clipboard with this application.--typerxdotool,wtype(automatically chosen)Type the characters using this application.--keybinding-copy,--keybinding-type,--keybinding-clipboard,--keybinding-unicode,--keybinding-copy-unicodeAlt+c,Alt+t,Alt+p,Alt+u,Alt+iChoose different keybindings than the default values.Example config file~/.config/rofimoji.rc:action = copy
files = [emojis, hebrew]
skin-tone = moderateActionsThe--action(-a) option defines what action will be taken when a character is selected. Multiple actions can be specified with a space character in between (for example:-a type copy).
The options are:nameshortcutdescriptiontypealt+tDirectly type the characters into the last active window. This is thedefaultcopyalt+cCopy them to the clipboard.clipboardalt+pInsert the selected characters through pasting from the clipboard, instead of directly typing them. SeeInsertion Method.unicodealt+uType the unicode codepoints of the selected characters.copy-unicodealt+iCopy the codepoints to clipboard.printPrint the chosen characters tostdout.Insertion methodBy default,rofimojitypes the characters using eitherxdotoolorwtype(seedisplay server support). You can enforce this behavior with--action type(-a type).For some applications (f.e. Firefox), this does not work reliably. To work around this,rofimojican copy the emojis to your clipboard and insert them from there withshift+insert. Afterwards, it will restore the previous contents.
Unfortunately, it depends on the receiving application whethershift+insertuses the clipboard or the primary selection.
Therefore,rofimojiuses both and also restores both.
To use this workaround, you can either use the keybindingalt+por start it asrofimoji --action clipboard(-a clipboard).
If you want to have it directly typed instead, you can hitalt+t, even though it was started with--action clipboard. Note that you canchange the keybindings.Finally, with--action copy(or-a copy) you can also tellrofimojito only copy the selected characters to your clipboard.Display server supportrofimojisupports both X11 and Wayland by using eitherrofi,xsel/xclipandxdotoolon X11 orwofi/fuzzel/some other adapterrofi,wl-copyandwtypeon Wayland. It tries to automatically choose the right one for the currently running session.
If you want to manually overwrite this, have a look at the--selector,--clipboarderand--typeroptionsabove.Please note that neitherwofinorfuzzelsupport custom keyboard shortcuts, recent files or a grid theme at the moment.Most recently used charactersBy default,rofimojiwill show the last ten recently used characters separately; you can insert them withalt+1,alt+2and so on. It will use the defaultinsertion method.
If you don't want this, you can set--max-recentto0.Additionally,rofimojialso remembers in general which characters are used more frequently and sorts the list accordingly. You can disable this behavior with--no-frecency.Supported charactersObviously,rofimojiis mostly used for emojis. However, it also supports all other Unicode blocks, for examplemathematical symbols,Greek and CopticorLinear B (Ideograms). Simply load them with-f(seeoptions).
If you miss something that should be there, please open an issue.Custom character files and descriptionsIf the predefined ones are not enough, you can define additional character files and load them with-f(seeoptions). In each line, one 'character' can be defined, followed by a single space character (). After that, you can write whatever description you want.If the character is also in another selected file, all descriptions will be combined. If you give it the same name as one of those included withrofimoji, yours will be preferred.For added comfort,rofimojiwill automatically load an "additional" file for predefined ones. This file needs to called<filename>.additional.csvand lie in${XDG_DATA_DIR}/rofimoji/data/. For example, if you want to extendemojis_smileys_emotion, call the fileemojis_smileys_emotions.additional.csv. This is helpful if you want additional descriptions: You can define such an additional character file, add the character and your description and your descriptions will now also be shown.If you think your file is useful to others, please open a PR to include it in a future version ofrofimoji.Rofi themingBy default,rofimojire-uses the existing rofi configuration, but you can pass your own using--selector-args(for example--selector-args="-theme ~/your-rofi-theme.rasi").If you would like a more character-focused theme, you can use packagedgrid.rasitogether with the--hidden-descriptionsparameter. This theme still imports the existingroficonfiguration but moves the entries into a grid. Of course, you can base your own theme on this. (If you have improvements, please open a PR!)
To use the arrow keys inrofionly for the grid and not the query, pass these-selector-args:-kb-row-left Left -kb-row-right Right -kb-move-char-back Control+b -kb-move-char-forward Control+f.InstallationFrom distribution repositoriesFrom PyPIrofimojiis onPyPI. You can install it withpipx install --user rofimoji(orsudo pipx install rofimoji).From GithubDownload the wheel file of thelatest releaseand install it withsudo pip install $filename(or you can usepip install --user $filenameto only install it for the local user).
Afterwards, there should be arofimojion your$PATH.
This also installs the python dependencyconfigargparse.DependenciesWhat else do you need:Python 3.8 or higherA font that can display your scripts, (for emojis,EmojiOneorNoto Emojiwork)rofi(in version 1.6.0 or higher if you want to use the mode),wofiorfuzzelA tool to programmatically type characters into applications. Eitherxdotoolfor X11 orwtypefor WaylandA tool to copy the characters to the clipboard.xselandxclipwork on X11;wl-copyon Wayland