The icon in the OSX Dock is decided by the Info.plist entry CFBundleIconFile when the application is not running. The application can then alter this icon when running. The only icon that does not conform to this is the Calendar icon, which always shows the actual current day, even if the application is not running. How is this achieved? I checked the .app and the Info.plist and there's nothing pointing me toward the mechanism. Is Calendar handled magically by the Dock?
Check Date & Time preferences in the corner of the window, then enter your administrator password to unlock the settings. (The settings are dimmed when locked.) In the Date & Time pane, make sure that ”Set date and time automatically” is selected and your Mac is connected to the internet.
To show the date in the menu bar, also select “Show date” in the Dock & Menu Bar preferences. On your Mac, choose Apple menu > System Preferences, then click Language & Region . Click the Region pop-up menu, then choose a geographic region to use the region's date, time, number, and currency formats.
In the Calendar app on your Mac, choose Calendar > Preferences, then click Accounts. Select the account, click the Refresh Calendars pop-up menu, then choose an option.
AppKit allows you to create Dock Tile plug-ins by adopting the NSDockTilePlugIn protocol. Dock Tile plug-ins are packaged as bundle inside a main app. They are loaded into the SystemUIServer
process and therefore can update the dock icon even if the main app is not running.
Details can be found in the Dock Tile Programming Guide.
Apple provides a simple Dock Tile sample here. Sadly that sample seems to be a bit flaky when running on newer OS X versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With