Skip to content

fotonick/faster_unicode_symbol_search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuss

Fuss is the Faster Unicode Symbol Search workflow for Alfred. It allows for the rapid search and insertion of Unicode into your frontmost app window. Useful for finding the right emoji or the right symbol in specialized applications like science or engineering.

Fuss is a reimplementation of the highly useful Unicode Symbols Search, but much faster. I was a heavy USS user, but it would take hundreds of milliseconds to perform a search, which is visible when Alfred runs a new search for every character you type. Fuss achieves a steady 16 ms on my Mac Mini, which humans generally perceive as instantaneous.

For example, let us write that the thickness of paper is generally 70–100 µm.

Animation of fuss search for micro

Installation

Fuss is a workflow for Alfred 5, a powerful and extensible launcher for macOS. Install Alfred, buy the Powerpack (required to import workflows), then open the latest fuss workflow release.

Because I have not gone through Apple's (non-free) developer signing process, macOS will forbid you running the fuss executable. You can whitelist it by:

  1. In the Alfred Workflow list, right-click on the Faster Unicode Symbol Search and select Open in Finder.
  2. In the Finder window that pops up, right-click on the fuss executable and select Open. This will give you the same scary popup as before, but now you have an Open Anyway option.
  3. Select Open Anyway and authenticate when prompted.

If you don't trust my release, examine the source code of this repository and build it yourself with the instructions further below. Yay, open source.

Usage

When you invoke Alfred with your assigned hotkey, generally ⌥␣ (option-space), type fuss, a space, then whatever you want to search for.

Examples

Image of fuss search for capital delta Image of fuss search for lightning Image of fuss search for plus or minus Image of fuss search for speed

Performance

On my late 2012 Mac Mini, I see that

hyperfine --export-markdown fuss_performance.md --warmup 3 "fuss capital delta" "python3 unicode_symbols_search.py capital delta"

produces:

Command Mean [ms] Min [ms] Max [ms] Relative
fuss capital delta 16.3 ± 1.0 14.8 21.1 1.00
python3 unicode_symbols_search.py capital delta 126.5 ± 3.0 119.3 132.5 7.77 ± 0.52

Profiling via cargo bench reveals that the actual search only takes ~2 ms. By commenting pieces of the main function out, I've determined that ~3 ms is overhead, and the remaining ~11 ms is in loading the pre-parsed symbols database embedded within the executable. Supposedly, Cap'n Proto is faster than bincode for such deserialization, but I didn't feel that it was worth going any further.

Building from source

Fuss is written in the Rust programming language. The rust toolchain can be installed via brew install rustup; rustup-init if you use Homebrew, or else from the rustup website directly. Then:

# one-time setup
cargo install cargo-make

# build and package
cargo make package

# install / import into Alfred
open "Faster Unicode Symbol Search.alfredworkflow"

To bump the version number of the Alfred workflow, edit info.plist near the bottom:

    <key>version</key>
    <string>0.1</string>

License

This software is released under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion into this project shall be licensed as MIT, without any additional terms or conditions.

About

Alfred workflow for rapid search and insertion of Unicode into your frontmost app window

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages