Jump to content

Calm Notifications — Toggle Do Not Disturb Focus Mode


Recommended Posts

  • 3 months later...
Posted

Hello! Complete newbie here, running Alfred 3.6 on Mac OS 10.9.5

 

Nothing happens when typing in dnd (I have allowed Alfred to control my computer in the privacy settings).

 

Could you please advise?

 

Thanks!

Posted

Welcome @Christophe,

 

Unfortunately, your macOS version is too far behind for me to be able to help. The solution needed to toggle Do Not Disturb is already somewhat hacky, and as far as I can tell earlier versions of macOS required different methods.

Posted

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!)

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

  • 6 months later...
Posted
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:

 

Posted

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.

 

 

Posted
On 2/25/2018 at 12:45 AM, vitor said:

The solution needed to toggle Do Not Disturb is already somewhat hacky

 

Saw this remark from a while ago, and things may have changed.  What method do you use to adjust this setting ?

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

  • 1 month later...
Posted
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.

Posted
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

 

  • 2 months later...
Posted

Hi Victor,

Thanks for the worklfow, but I am having the same issue (in macOS 10.13.6) that when I turn DND off, the Notification icon in menu bar does NOT turn from Grey back to Black.

Please advise.

Thanks,

Matthew

Posted
13 hours ago, mlondon said:

Thanks for the worklfow, but I am having the same issue (in macOS 10.13.6) that when I turn DND off, the Notification icon in menu bar does NOT turn from Grey back to Black.

 

The old post still applies:

 

  • 7 months later...
Posted (edited)

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
Posted

Works perfectly in Monterey, thanks so much Vitor! It's so helpful to use this throughout the day. 🙌

 

Is the green icon a baby's bottle? That's one thing that confused me 😂

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

  • 2 weeks later...
  • 3 weeks later...
  • 5 weeks later...
Posted

On Macos BigSur, it open Skype 🤔

 

I think it's the shortcut (the app doesn't exist on Big sur) :D

658268777_Screenshot2022-01-29at18_42.40@2x.thumb.png.37eaebc85f0528b8108d0749770bea91.png

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