Jump to content

Calm Notifications — Toggle Do Not Disturb Focus Mode


Recommended Posts

  • 3 months later...

Thanks Vitor for your response. I suspected that the OS might be the problem. Your workflows that only work within Alfred (eg Ping Pong or FormatSize) work well, but any other that trigger something outside (like dnd, TemplatesManager, TemporaryEmail) don't do anything.

 

Maybe one day I'll upgrade my OS :P (or learn to code!)

Link to comment
3 hours ago, Christophe said:

any other that trigger something outside (like dnd, TemplatesManager, TemporaryEmail) don't do anything.

 

TemplatesManager is expected not to work, as it uses JavaScript for Automation (JXA) and that was only introduced in Yosemite (10.10). As for TemporaryEmail, it uses regular AppleScript, so it should work, unless something has changed since Mavericks.

 

Workflows of mine that should work for you are the ones that don’t interact with a GUI, as for that one needs AppleScript/JXA. So macOS-specific apps/features (Finder, Notification Center) and browser interactions are out. Some of the older ones might still work, like IncognitoClone.

 

But you should really update your OS. By staying so far behind you’re exposing yourself to some potentially nasty bugs.

Link to comment
  • 6 months later...
5 hours ago, akishaha said:

Its not working on High Sierra. ☹️ Can anyone help me ?

 

Welcome @akishaha,

 

Please don’t post “it’s not working” messages, as that doesn’t help us help you. How is it not working? What were the exact steps you took? What happened (or didn’t)?. What was the out put of the debugger with the log output set to “All Information”?

 

Here’s how to post an effective bug report:

 

Link to comment

Minor issue: Toggling dnd off ("turn it off") works, but the Notification Center icon remains dimmed as though Do Not Disturb is still on. I'm using High Sierra 10.13.6

 

Do Not Disturb on

1403864778_dndon.png.c359835ad865434987ceee01907a2572.png

 

Do Not Disturb off 

1795580742_dndoff.png.ec7550451a93354643887893d6efcde5.png

 

If I toggle Do Not Disturb off manually, it reverts to the darker icon as a visual cue. If I toggle using the workflow it remains faded.

 

 

Link to comment
7 hours ago, evanfuchs said:

Minor issue: Toggling dnd off ("turn it off") works, but the Notification Center icon remains dimmed as though Do Not Disturb is still on.

 

That may not be something fixable, due to the nature of the hackiness required.

 

7 hours ago, evanfuchs said:

I'm using High Sierra 10.13.6

 

I’m on Sierra, but I will update to Mojave. If I look at this, it will be then.

 

2 hours ago, CJK said:

Saw this remark from a while ago, and things may have changed.

 

Unlikely. Apple is making automation harder, not easier.

 

2 hours ago, CJK said:

What method do you use to adjust this setting ?

 

The defaults method. It’s easier if you open the Workflow and see for yourself; it’s straightforwards Bash, and just a few lines.

Link to comment
  • 1 month later...
On 9/16/2018 at 6:14 PM, vitor said:

The defaults method. It’s easier if you open the Workflow and see for yourself; it’s straightforwards Bash, and just a few lines.

 

Thanks for sharing.  I need to implement this in AppleScript.  I don't have Alfred, but I downloaded your Workflow, but don't see the Bash.  Would you mind posting the Bash here, or providing a direct link to it?

 

Thanks.

Link to comment
6 hours ago, JMichaelTX said:

Would you mind posting the Bash here

 

action="${1}"

if [[ "${action}" == 'on' ]]; then
  defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturb -boolean true
  defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturbDate -date "$(date -u +'%Y-%m-%d %H:%M:%S +0000')"
  killall NotificationCenter
else
  defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturb -boolean false
  killall NotificationCenter
fi

 

Link to comment
  • 2 months later...
  • 7 months later...

Updated for Monterey and removed support for older macOS versions. Also, added support choosing a length of time for Do Not Disturb to be active!

 

It now uses a macOS Shortcut to do its task. Hopefully that means Apple won’t keep forcing us to come up with new solutions.


The Shortcut is included, and you’re propped to install it on first activation:


IhzKVLN.png


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.

 

If you’re on Big Sur and version 21.7 of this Workflow, the update won’t trigger until you update. The version you have should keep working.

Edited by vitor
Link to comment
1 hour ago, alfredpanda said:

Works perfectly in Monterey, thanks so much Vitor!


Great! Glad to read that. Hopefully by using a Shortcut it means imApple won’t break the functionality in a future macOS version.

 

1 hour ago, alfredpanda said:

Is the green icon a baby's bottle?


Yes. Baby bottle to calm down, battery to energise.

Link to comment
  • 2 weeks later...
  • 3 weeks later...
  • 5 weeks later...

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...