Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does OSX keep the Calendar icon in the dock updated to the current date?

Tags:

macos

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?

like image 577
Stefano Borini Avatar asked May 23 '14 12:05

Stefano Borini


People also ask

Why does my Calendar show the wrong date on Mac?

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.

How do I show the date on my Mac Dock?

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.

How do I update the Calendar on my Mac?

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.


1 Answers

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.

like image 62
Thomas Zoechling Avatar answered Oct 02 '22 13:10

Thomas Zoechling