{"id":18737598,"url":"https://github.com/rrroyal/automaticdocktile","last_synced_at":"2025-07-08T13:04:41.811Z","repository":{"id":44411181,"uuid":"312690187","full_name":"rrroyal/AutomaticDockTile","owner":"rrroyal","description":"Change the dock tile icon on theme switch ✨","archived":false,"fork":false,"pushed_at":"2020-11-14T01:13:42.000Z","size":86,"stargazers_count":73,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T14:04:26.383Z","etag":null,"topics":["macos","nsdocktileplugin","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rrroyal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-13T21:42:36.000Z","updated_at":"2024-10-01T06:55:17.000Z","dependencies_parsed_at":"2022-07-12T18:20:58.985Z","dependency_job_id":null,"html_url":"https://github.com/rrroyal/AutomaticDockTile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrroyal%2FAutomaticDockTile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrroyal%2FAutomaticDockTile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrroyal%2FAutomaticDockTile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrroyal%2FAutomaticDockTile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rrroyal","download_url":"https://codeload.github.com/rrroyal/AutomaticDockTile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248621302,"owners_count":21134803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["macos","nsdocktileplugin","swift"],"created_at":"2024-11-07T15:25:52.670Z","updated_at":"2025-04-12T19:32:27.085Z","avatar_url":"https://github.com/rrroyal.png","language":"Swift","readme":"\n# AutomaticDockTile\n\nA day after the Big Sur release, I've noticed that the icon of [Nova](https://nova.app) by [Panic](https://panic.com) changes colors when switching between light and dark mode. **Here's how it looks like:**  \n![Preview GIF](preview-nova.gif)\n\nI [tweeted](https://twitter.com/destroystokyo/status/1327224712578142209) about it immediately, and few hours later looked up how to do this. There were no results about it, so I started tinkering around. I examined all of the `.car`'s and `.icns`'s, but there was nothing. So I checked how to update the dock icon and I've stumbled upon [NSDockTilePlugin](https://developer.apple.com/documentation/appkit/nsdocktileplugin) - bingo!\n\nUnfortunately, it wasn't *that* easy - there's not much documentation on how to use it, but there's [one example project](https://github.com/CartBlanche/MacDockTileSample). It's in Objective-C (which I've never used) though - not optimal, but I can work with that.\n\nAfter around two hours I've managed to successfully register the Swift-based plugin (**protip:** create new bundle, set the principal class and register the plugin in the host app with `NSDockTilePlugIn`. If something isn't working, console is your best friend). Now, let's do the theme-changing part.\n\nWhile reverse-engineering the `NovaDockTile` plugin I saw some observer-related code. Basic publisher for `NSApp.effectiveAppearance` did the job just fine.\n\nTa-da! Icon's updating on theme change ✨.  \n![Preview GIF](preview.gif)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrroyal%2Fautomaticdocktile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frrroyal%2Fautomaticdocktile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrroyal%2Fautomaticdocktile/lists"}