将隐藏通知徽章专注模式设置从 iOS 添加到 macOS

FocusPlsNoBadges

演示 GIF:打开专注模式,观看徽章消失,关闭模式,然后观看徽章恢复

将“隐藏通知徽章”焦点模式设置从iOS添加到macOS,以一种非常粗俗和黑客的方式。

Getting started

  1. Build the Xcode project
  2. Run the app (or archive it, put it somewhere nice, and set macOS to start it at login – since the app can’t do this yet)
  3. Change to a Focus mode that has ‘Hide Notification Badges’ enabled (you’ll have to set this on iOS and let it iCloud sync, the app doesn’t let you set it om macOS)

How it works

  1. Every second (for now) we check the Focus mode preferences to see if the current Focus mode (if any) requests notification badges hidden
  2. If so, we modify the Notification Center preferences to disable badges for all apps, and record which apps it was disabled for in our own preferences.
  3. If not, we read any apps for which we disabled badges from our preferences, and modify the Notification Center preferences to enable badges for those apps.
  4. If we made any changes to the Notification Center preferences, we restart to update the state.usernoted

Downloads

Coming soon

Anything else?

  • Yeah.
  • It can’t hide some system apps’ badges, like System Preferences.

GitHub

点击跳转