Jump to content

Do Not Disturb, Limited


Recommended Posts

I've incorporated @paulw snippet to hopefully support Big Sur and previous releases. I can only test on Catalina currently, so if anyone on Big Sur would try out v0.1.3 I would really appreciate it! Let me know how it works out.

 

@paulw While it might work to make mods to that plist file to do the enable/disable, I assume it'd be roughly equivalent to modifying the similar plist file in Catalina and before. That means we'd need to kill the Notification Center process to force a re-read of the preference. However, the indicator would be out of sync, which is why I opted for the keyboard shortcut method, even though that requires more manual setup.

Link to comment

@paulw Nice catch!... Always good to see collaborative work.

 

I tested too (not thoroughly) and had mixed results. Tried twice in a row and second time didn't work (turned on dnd but didn't turn off after desired minutes). On second try the 'disable' part never ran. Maybe I didn't give it enough time because of the mentioned delay, if I try to replicate while typing slowly = it works.

Link to comment
  • 4 weeks later...
  • 1 month later...
  • 1 month later...
  • 2 weeks later...
1 hour ago, jmueller said:

This one seems to work, even though it's capability is limited to toggling on and off. 

 

And showing the current state. I’ve been considering for a while to add support for timed disable, but I want to do it by properly editing the right files (like the rest of the Workflow works) so it doesn’t clash with manual use.

 

Apple has a propensity for breaking programatic ways of editing DnD with new OS releases, and macOS Monterey has a new “Focus” which might turn everything into disarray, so I’m waiting to first see how this works on macOS 12 and then decide about the timed disable.

Link to comment
25 minutes ago, deanishe said:

I'm getting OS names mixed up again like a fool. The page says it doesn't work on Monterey.

 

Ah, makes sense. Yeah — I talked to the developer and he did mention that Apple has a tendency to switch up the DND API... and it's very likely there'll be some wonkiness w/ Monterey given its big push on focus modes.

Link to comment
  • 3 weeks later...
  • 3 months later...
  • 3 weeks later...

@troycurtisjr Thanks so much for making this, it's my most-used workflow in Alfred. It still seems to work in Monterey however the status is wrong - it always says "turn it off" despite it not being on. I believe it does actually still work with times - i.e "dnd 30", it's just the status that is wrong.

 

Do you think there's an easy fix for this?

 

image.thumb.png.d1efe51a2478e0c25ad9d75c3482bf1d.png

 

image.png.5db3ee51b59e7618ce37d00c8fb9cad4.png

Edited by alfredpanda
Link to comment

I'm not on Monterey yet, so I can't troubleshoot what is going on. Unfortunately MacOS doesn't give us a great interface to this functionality, so everything is a little bit hacky. And since this doesn't use an official interface, it changes randomly on upgrades!

 

If anyone is able to dig in to figure out what needs to happen on Monterey, I can definitely add to the code. Otherwise, I'll give it a try once I upgrade which will probably be a bit. Maybe over Thanksgiving since my only Mac is my work laptop and I can't risk killing my environment for a few days 😉.

Link to comment
  • 4 weeks later...

@troycurtisjr I just updated CalmNotifications for Monterey, in case you want to get ideas.


We can still get the Do Not Disturb status programatically, but turning it on and off is more difficult. I ended up building a macOS Shortcut to do it, which is installed with the Workflow.


Worth noting that I have also added the option to activate it for a length of time, measured in either minutes or hours.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...