Tofu

Published by FIGBERT on
< Back

Tofu is an easy-to-use, open-source, two-factor authentication app designed specifically for iOS, made by Calle Luks. I adopted it after migrating from Authy, and ended up overhauling its icon system.

It’s a really well designed app:

A screenshot of Tofu in action

When I migrated to Tofu, it had a limited number of hand-designed icons in one big Sketch file. Each icon was created and exported manually. I set out to simplify the process, and Calle proposed we create a shell script to generate icons on-demand from a folder of pngs.

I got my shell hat on and a week later, my pull request was commited to upstream with a brand new bash script. The script iterates over a given directory using sed and regex to grab the names of each png inside and add them to Xcode’s assets folder. It uses a heredoc as a template for the new imageset’s JSON, and the sips cli to generate properly sized icons for use in the app.

Contributing to open source projects is incredibly fun. If you’ve got a free weekend, take some time to hack on your favorite codebase. Big thanks to Calle for creating such an awesome app – I look forward to collaborating more in the future.

Download the app on the App Store, and explore the source code on GitHub.