Mac下的万年历状态栏小工具

Chinese Lunar Calendar for Mac in MenuBar

源代码@Github 下载程序(官方API版本) 下载程序(OS<=10.10.4)

注意: 升级到OSX 10.11的同学,请使用官方API的版本。使用NSMenuExtra版本的将无法在10.11上打开。具体区别请看下面的说明:

There are in fact two types of such menu bar items, one known as NSMenuExtra's and another known as NSStatusItem's. The former are loaded and displayed by SystemUIServer, a process provided by the system. The latter can be displayed by any app written by any developer. One good thing about the former is that you can rearrange them by ⌘-dragging the menu items.

Anyway, due to this better behavior of NSMenuExtra's, people often wanted to write their own. In fact until and including OS X 10.1, Apple allowed it. But since 10.2, Apple had a code that blocked SystemUIServer to load non-system-provided NSMenuExtra's. But until Yosemite, there was a known way to work around it, available as an open-source code as MenuCracker. WanNianLi used this to inject their own NSMenuExtra's to SystemUIServer.

Essentially, until Yosemite, SystemUIServer had a fixed list of allowed NSMenuExtras. MenuCracker was an NSMenuExtra that pretended to be one of those allowed ones, which, once loaded inside SystemUIServer, removed these checks, so that more NSMenuExtras can be loaded without any problem. In OSX 10.11 El Capitan, Apple added a more stringent check of the allowed NSMenuExtra's, and MenuCracker no longer works.


1.界面




更新历史:BUILD.md


2.功能

  • 从状态栏快速弹出含农历及节日的万年历
  • 可以按(前/后)(年/月)的方式改变日期,也可以直接选择年月
  • 支持键盘控制日历: ←上一年, →下一年,↑上一月,↓下一月,↵回今日
  • 点击选择某一天,长按显示更详细的信息
  • 支持国内的假期调整:周末上班或者工作日放假; 支持在线更新假期调整方案,一般在年末的时候需要更新一次
  • 支持增加属于个人的农历、公历节日(vim ~/Library/Application\ Support/com.zfdang.calendar/festivals.js)。节日每年会重复。
  • 支持增加指定日子的事件(vim ~/Library/Application\ Support/com.zfdang.calendar/holidays.js CALENDAR_EVENTS)。事件是一次性的,不会按年重复。
  • 可设置开机自启动
  • 兼容OS X 10.8, 10.9, 10.10, 10.11
  • 开源

  • 遇到“无法打开”的错误: 请参看Mac基础教程-如何打开身份不明开发者的应用程序


    3.视频介绍@Youku




    4.建议使用方法

    1. 调整Mac的时钟设置,在状态栏中隐藏日期信息,保留时间和星期
    2. 将本程序的图标拖至Mac时钟的左侧

    5.声明

    • #include <disclaimer.h>
    • 如商用,须征得本人同意