Skip to content
ARE404Public

About

Try an app icon in your actual macOS Dock — browse a folder of candidates, click to swap the real Dock icon.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

DockFit

DockFit icon

中文说明

A tiny macOS app for trying an icon in your actual Dock. Point it at a folder of candidates, they show up as a grid, and clicking one replaces this app's own Dock icon with it — sitting right next to the apps you use every day, where size, contrast and recognizability are immediately obvious.

The neighbours are the whole point. An icon that looks great at 1024px in Preview can be mush at 40pt between Safari and Slack, or a size too big because it was exported edge to edge.

Why another one

  • Sindre Sorhus' Icon Preview is free but closed source, and you drag files in one at a time (or drive it through Shortcuts).
  • david-swift/IconPreview is open source but simulates the Dock inside its own window, and was archived in 2024.

DockFit fills the gap in between: browse a whole folder, and swap the real Dock icon with one click.

Download

Grab DockFit-<version>-universal.zip from the latest release, unzip it and drop DockFit.app into /Applications. Universal (Apple silicon + Intel), macOS 14+.

The build is ad-hoc signed, not notarized — I don't pay for a Developer ID — so the first launch needs one nudge:

xattr -dr com.apple.quarantine /Applications/DockFit.app

Or open System Settings → Privacy & Security right after macOS blocks it, and click Open Anyway. Prefer to skip all that? Build it yourself, it takes four seconds.

Build & run

No Xcode project, no dependencies — the Command Line Tools are enough (swiftc plus a hand-assembled bundle). Requires macOS 14+.

./build.sh
open build/DockFit.app --args /path/to/icons   # or just double-click it

Using it

  • Pick a folder, or drop one on the window or on the Dock icon.
  • Subdirectories are scanned too, and grouped by folder (or by format, or not at all).
  • Click a thumbnail to apply it. ← / → step through the current results — good for a fast A/B.
  • Edit a file in your editor and it reloads and re-applies itself, so you can draw and watch the Dock at the same time.
  • Search by name, filter by format / pixel size / "has padding", sort by name, pixel size, modification time, padding ratio or file size.
  • PNG, JPEG, TIFF, HEIC, PDF, SVG and ICNS all work — SVG and ICNS are decoded by NSImage natively, with every representation of an .icns read in at once.

The two things built specifically for "how big is this thing, really"

Checkerboard backing. Thumbnails sit on a checkerboard rather than a solid colour, so a transparent margin is visible at a glance.

Padding readout. The bottom bar reports pixel dimensions, representation count, and the fully transparent border as a percentage of the width. That number is what decides whether your icon matches its neighbours in the Dock: macOS lays app tiles out on an 824-of-1024 grid, i.e. ~9.8% margin on each side. A full-bleed image (0%) drops into the Dock visibly larger than everything around it.

"Pad to the macOS grid" toggle. Scales the image to 824/1024 before handing it to the Dock, so you can compare a full-bleed export against a padded one without re-exporting anything.

Layout

Sources/Model.swift        scanning, transparent-inset detection, applying the Dock icon
Sources/Watcher.swift      FSEvents directory watching + thumbnail cache
Sources/Library.swift      state: current folder, filters, sorting, selection, padding
Sources/ContentView.swift  UI
Icon/make_icon.swift       draws the app's own icon and packs it into AppIcon.icns
build.sh                   packages the .app straight from the command line tools
release.sh                 same, but universal (arm64 + x86_64) and zipped for a release

Its own icon

A question mark — "which one of these should the icon be?" is the entire reason this app exists, and Restore default icon puts it back after you have been trying candidates.

It is drawn by Icon/make_icon.swift rather than by hand, because an app that measures other people's icon padding has no business getting its own wrong. The tile sits on the 824-of-1024 grid, its corners are CoreAnimation's continuous curve rather than a circular arc, its silhouette is feathered by the few pixels every stock icon is feathered by, and its contact shadow reaches the same 8 above / 24 below / 16 to the side that ten of Apple's own icons measure at 1024. Sampled at fixed rows, the corner profile tracks a stock icon's to within about three pixels.

swift Icon/make_icon.swift graphite        # the one that ships; also blue / amber / teal
swift Icon/make_icon.swift teal --sheet    # also writes every colourway to Icon/preview/

Metadata for every file is computed off the main thread in batches and cached on path + mtime, so a folder of a few hundred icons still paints immediately.

Note

The interface strings are currently Simplified Chinese. Everything else — code, comments, docs — is English. Localization PRs welcome.

License

MIT

About

Try an app icon in your actual macOS Dock — browse a folder of candidates, click to swap the real Dock icon.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages