IconRulesAgent is a lightweight macOS menu bar utility that watches a directory of per‑app icon rules and applies custom icons to your apps. It runs without a Dock icon and provides a status bar menu plus a drag‑and‑drop window to quickly add apps.
- Menu bar app (no Dock icon)
- Watches a configurable rules directory (
watch_dir) - Applies per‑app custom icons automatically
- Drag‑and‑drop window to add
.appbundles - Handy menu actions: Open Rules, Open Logs, Reload & Reapply, Quit
At a high level:
- On launch, the app loads (or creates) a config file at
~/.icons/config.confand ensures the configuredwatch_direxists. - A file system watcher observes
watch_dirand relevant application folders for changes. - For each rule folder inside
watch_dir, the app:- Reads
rule.conffor one or moretarget=lines that point to app bundles. - Picks an icon image (e.g.,
default.icns,default.png, or anydefault.*). - Sets that image as the bundle’s custom icon and nudges Finder/Launch Services to refresh.
- Reads
- A drag‑and‑drop window lets you drop
.appbundles to create/update rule folders and theirrule.confentries.
- Open the project in Xcode (macOS target) and build/run.
- On first launch, the app:
- Hides its Dock icon (accessory activation policy).
- Creates default configuration and directories if they don’t exist.
- Shows a menu bar item you can click for actions.
Click the menu bar icon to open the app menu:
- Add App… (⌘D)
- Opens the “Drop Your App Here” window. Drag one or more
.appbundles into the window to add them as targets.
- Opens the “Drop Your App Here” window. Drag one or more
- Open Rules Folder (⌘O)
- Opens the configured
watch_dirin Finder.
- Opens the configured
- Open Logs Folder (⌘L)
- Opens the app’s log directory in Finder.
- Reload Config & Reapply (⌘R)
- Reloads configuration and reapplies icons across all rules.
- Quit (⌘Q)
- Exits the app.
- Title: “Drop Your App Here”.
- Drag one or more
.appbundles into the window. - The app will:
- Create (or reuse) a rule folder named after the app (e.g.,
MyApp). - Ensure a
rule.confexists and add atarget=/path/to/MyApp.appline if missing. - Open the rule folder in Finder so you can place an icon file.
- Create (or reuse) a rule folder named after the app (e.g.,
watch_dir/— the base directory for rulesMyApp/— a folder per target appdefault.icnsordefault.png— icon to apply (anydefault.*image works)rule.conf— text file with one or moretarget=entries
Example rule.conf: