index.md (2057B)
1 +++ 2 title = "Tofu" 3 date = 2021-04-07 4 weight = 4 5 +++ 6 7 [**Tofu**][tofu] is an easy-to-use, open-source, two-factor 8 authentication app designed specifically for iOS, made by 9 [Calle Luks][calle]. I adopted it after migrating from Authy, 10 and ended up overhauling its icon system. 11 12 <!-- more --> 13 14 It's a really well designed app: 15 16 ![A screenshot of Tofu in action][sc] 17 18 When I migrated to Tofu, it had a limited number of hand-designed 19 icons in one big [Sketch file][sketch]. Each icon was created and 20 exported manually. I set out to [simplify][issue] the process, and 21 Calle [proposed][proposal] we create a shell script to generate 22 icons on-demand from a folder of pngs. 23 24 I got my shell hat on and a week later, [my pull request][pr] 25 was commited to upstream with a brand new bash script. [The 26 script][script] iterates over a given directory using `sed` 27 and [regex][post] to grab the names of each png inside and add 28 them to Xcode's assets folder. It uses a [heredoc][heredoc] as 29 a template for the new imageset's JSON, and the `sips` cli to 30 generate properly sized icons for use in the app. 31 32 Contributing to open source projects is incredibly fun. If you've 33 got a free weekend, take some time to hack on your favorite codebase. 34 Big thanks to [Calle][calle] for creating such an awesome app – I 35 look forward to collaborating more in the future. 36 37 Download the app [on the App Store][store], and explore the source 38 code [on GitHub][tofu]. 39 40 [tofu]: https://github.com/calleluks/Tofu 41 [calle]: https://www.calleluks.com 42 43 [sc]: accounts.jpg 44 45 [sketch]: https://github.com/calleluks/Tofu/blob/d6b4544f7a996fd2c7a4feaa77cdee7735240749/IssuerIcons.sketch 46 [issue]: https://github.com/calleluks/Tofu/issues/52 47 [proposal]: https://github.com/calleluks/Tofu/issues/52#issuecomment-760989928 48 49 [pr]: https://github.com/calleluks/Tofu/pull/60 50 [script]: https://github.com/calleluks/Tofu/blob/master/GenerateIssuerIconAssets.sh 51 [post]: @/posts/my-first-regex.md 52 [heredoc]: https://stackoverflow.com/a/2954835 53 54 [store]: https://apps.apple.com/app/tofu-authenticator/id1082229305