Search code examples
osx-yosemiteosx-yosemite-beta

How to detect dark mode in Yosemite to change the status bar menu icon


The status bar app icon has to be changed when dark mode is enabled in Yosemite. How to detect if dark mode has been enabled ? Is there any notification for the same ?

Is it better to display another image or change the alpha value of existing Image ? Need inputs on which is the better way to go ??


Solution

  • The Status bar icon needs to be a template image. Just set the setTemplate:Yes to NSImage. And when switched to dark mode , the vibrancy should apply.