William Hatch <email@example.com>
|(require the-unicoder)||package: the-unicoder|
This is a tool for inputting Unicode characters.
At the moment it only works on Unix systems running X11, and it requires the program xdotool to be installed. If you know how to do what xdotool does on OSX or Windows, let me know.
To use the-unicoder, simply run the-unicoder or racket -l the-unicoder in a terminal or from a keyboard shortcut. When the window pops up, simply type in the description for the unicode character you want. the-unicoder will display the top ten results for your query so far, and when you hit enter the dialog will go away, and the top result will be sent to the focused window (whatever was focused before starting the-unicoder). The top match will be the shortest description that matches each word in your query string. Included descriptions are the official descriptions from the unicode standard, short latex-style names, and custom descriptions/names you configure yourself.
Here are some screenshots:
You may notice that its startup time is too long to make it terribly useful for common use. To improve this, you can run a the-unicoder server and send it commands with a the-unicoder client.
Summary of options below:
--server: Run a server that accepts commands.
--client: Send a command to the server.
--path <path to socket>: use a Unix domain socket at that path. Currently only available on Unix-y systems like GNU/Linux, BSDs, and MacOSX. But since the-unicoder currently only WORKS on X11 systems which are generally only used on GNU/Linux and BSDs, that doesn’t seem like a huge issue. Unless this or the --port option is used, the default socket for client/server interaction is a Unix port at $XDG_RUNTIME_DIR/the-unicoder/the-unicoder-socket
--port <port number>: use the given TCP port. While it only accepts connections from localhost, it will still let anyone else with access to your machine send commands. So, be ye warned.
--command <command name>: Which command to use with the client. Options are prompt (the default), and reload (reloads configuration files).
--help: Show a list of options.
the-unicoder configuration files live in $XDG_CONFIG_HOME/the-unicoder/unicoder-table ($XDG_CONFIG_HOME defaults to $HOME/.config on Unix and C:\Users\username\AppData\Local on Windows), or in $dir/the-unicoder/unicoder-table where $dir is any directory in $XDG_CONFIG_DIRS. Multiple can be specified.
unicoder-table should consist of a single hash table readable by the default racket reader, like so:
#hash( ("description of the letter upsilon" . "υ") ("description of the couch emoji" . "🛋") ("lam" . "λ") ("ycpash" . "you can put a string here") )
The code is available on github.
Except where noted, all files in the project are licensed under the terms of the LGPL version 3, or (at your option) any later version published by the Free Software Foundation (IE LGPL3+).