alfredpanda Posted June 7, 2022 Share Posted June 7, 2022 @vitor I still love this and use it many times per day. It's probably what I use Alfred for the most, so thank you! One thing I stumble across is every now and again it hangs like in this video - it'll be stuck on "Getting status..." for a while, and I just have to wait until it finally shows the number before I hit return. Have you experienced this? I wonder if there's something known I can tinker with, or if anything is interfering with it. Link to comment
vitor Posted June 7, 2022 Author Share Posted June 7, 2022 15 minutes ago, alfredpanda said: I still love this and use it many times per day. It's probably what I use Alfred for the most, so thank you! Thank you for the kind words! 38 minutes ago, alfredpanda said: Have you experienced this? Never that long! For reference, the way I’m getting the status is by running the following command (you can try it in a terminal): /usr/bin/defaults read com.apple.controlcenter 'NSStatusItem Visible FocusModes' If it returns 0, Do Not Disturb is off; if 1, it’s on. That command may be taking long to execute on your machine, for some reason. Or it may be the check Apple does on executables. Do note the Workflow has an External Triggers, so if you don’t really care about the feedback and just want to turn it on or off, you can take advantage of that. I’ll eventually rewrite that part of the Workflow (so it no longer needs Ruby) and will check if macOS 13 has another way to check the status. alfredpanda 1 Link to comment
alfredpanda Posted June 7, 2022 Share Posted June 7, 2022 @vitor thanks for the reply! I wonder how I can debug what might be causing it. It must be something else I have running. Is there an easy way or do I just need to trial and error? 😄 It‘ll happen once or twice a day - the rest of the time it’s rapid ⚡️ Link to comment
vitor Posted June 7, 2022 Author Share Posted June 7, 2022 You can run the above command once in a while to see if it’s the one being slow. If it happens occasionally and those are after you haven’t used it in a while, I’d say it’s macOS checking the script. I have an idea which might work, but it’ll have to wait for the mentioned rewrite. alfredpanda 1 Link to comment
alfredpanda Posted June 8, 2022 Share Posted June 8, 2022 Thanks, I tried it via terminal and it returned 0 instantly. Thanks again for debugging with me 🙂 Link to comment
alfredpanda Posted June 9, 2022 Share Posted June 9, 2022 @vitor So I just noticed a delay, quickly backed out of Alfred, ran the script in Terminal which returned the number instantly, re-opened Alfred and CalmNotificaitons worked instantly. Hard to tell what causes the delay - but running the script in terminal almost fixed it - or made it work instantly? Link to comment
vitor Posted June 11, 2022 Author Share Posted June 11, 2022 Running the command right after getting the delay won’t work, because what (presumably) causes the delay is run once then cached for a while. Try this version and see if you still get the delay. It should still happen the first time, but no more after that. alfredpanda 1 Link to comment
alfredpanda Posted June 11, 2022 Share Posted June 11, 2022 (edited) 8 hours ago, vitor said: Running the command right after getting the delay won’t work, because what (presumably) causes the delay is run once then cached for a while. Try this version and see if you still get the delay. It should still happen the first time, but no more after that. So far so good!! Thanks so much ❤️ EDIT: Is it normal to take a while after the computer has been to sleep? Edited June 11, 2022 by alfredpanda Link to comment
Ghost Posted June 11, 2022 Share Posted June 11, 2022 @vitor I have the current problem: https://a.cl.ly/8Lu0jNeP I've tried to uninstall the workflow, deleted the shortcut, but not luck. It just shows that message shown above and I can't activate Calmnotifications I am on macOS Monterey 12.4, if that helps. Link to comment
vitor Posted June 12, 2022 Author Share Posted June 12, 2022 (edited) @Ghost I don’t see a problem. You opened Alfred, called dnd, and it gave you the current status. If you ↵, it flips it (if off, becomes on, and vice-versa). Edited June 12, 2022 by vitor Link to comment
Ghost Posted June 13, 2022 Share Posted June 13, 2022 @vitorI should have added more context. So that works if I have do not disturb on (manually turned on). But when I want to use dnd, even if I have do not disturb off, I still get the same message: https://a.cl.ly/o0uGgrq4 In my case, dnd works to turn of do not disturb but it doesn't work for turning it on. Hopefully that makes more sense. Link to comment
vitor Posted June 13, 2022 Author Share Posted June 13, 2022 @Ghost. I need your exact versions of:Alfred.macOS.CalmNotifications. Did it work previously for you and stopped, or has it always been like this? Also, turn Do Not Disturb on manually and run this in a Terminal: /usr/bin/defaults read com.apple.controlcenter 'NSStatusItem Visible FocusModes' What’s the output? Then turn Do Not Disturb off manually and repeat the command. What is the output? Link to comment
Ghost Posted June 13, 2022 Share Posted June 13, 2022 Alfred: 4.6.6 MacOS: 12.4 CalmNotifications: 21.9 Yea, it worked before not sure what the heck happened tbh I got this, when I manually turned it on: /usr/bin/defaults read com.apple.controlcenter 'NSStatusItem Visible FocusModes' 1 I got this when I manually turned it off: /usr/bin/defaults read com.apple.controlcenter 'NSStatusItem Visible FocusModes' 1 That being said, it seems the issue is on my end since the system detects focus mode as on even though it's not. At least that's what it seems like it after the command always returns 1. Link to comment
vitor Posted June 13, 2022 Author Share Posted June 13, 2022 2 hours ago, Ghost said: That being said, it seems the issue is on my end since the system detects focus mode as on even though it's not. At least that's what it seems like it after the command always returns 1. Yep, that is exactly right. Unclear why it’s happening, though. Do note the value sometimes takes a second or two to change. I’d think back if you installed something new recently which might be interfering. But before that I’d do a good old reboot, if you haven’t already. Link to comment
alfredpanda Posted June 14, 2022 Share Posted June 14, 2022 On 6/11/2022 at 3:06 PM, vitor said: Running the command right after getting the delay won’t work, because what (presumably) causes the delay is run once then cached for a while. Try this version and see if you still get the delay. It should still happen the first time, but no more after that. FYI I'm sure this version runs a lot better. Seems like the first time I use it each day its slower, but then haven't had it again. Thank you! vitor 1 Link to comment
jamesgc Posted July 15, 2022 Share Posted July 15, 2022 Does anybody have this working on Monterey? All mine ever says is "turn it off", even when Focus is off already. Thanks again for the workflow, i would use this multiple times a day if I could get it working! Link to comment
vitor Posted July 15, 2022 Author Share Posted July 15, 2022 3 hours ago, jamesgc said: Does anybody have this working on Monterey? The Workflow only works on Monterey, it uses a macOS shortcut. For Big Sur and below, a different solution is needed, as per the top post. 3 hours ago, jamesgc said: All mine ever says is "turn it off", even when Focus is off already. Note that the file macOS changes when Do Not Disturb is toggled takes longer to change from on to off than the reverse. It may take a few seconds for the Workflow to be able to see the result. I just pushed an update which rewrites the Workflow in JXA and auto-refreshes the state while Alfred’s window is open on dnd. If it still doesn’t work for you, see the conversation above with @Ghost. Link to comment
jamesgc Posted July 15, 2022 Share Posted July 15, 2022 (edited) I tried the terminal command from your conversation with ghost, it consistently returns a 1 for me, even if i wait a minute. No matter what focus mode I set manually. Also tried rebooting my machine. Edited July 15, 2022 by jamesgc Link to comment
vitor Posted July 15, 2022 Author Share Posted July 15, 2022 Figured out a better way to detect Do Not Disturb status. Seems to be both more reliable (does not depend on Menu Bar icon setting) and faster to return state. Just released a new Workflow version with the change. JJJJ 1 Link to comment
jamesgc Posted July 15, 2022 Share Posted July 15, 2022 10 hours ago, vitor said: Figured out a better way to detect Do Not Disturb status. Seems to be both more reliable (does not depend on Menu Bar icon setting) and faster to return state. Just released a new Workflow version with the change. Nice!!!!! It works perfect now!!! Thank you. Will be using this a lot! Link to comment
vitor Posted September 28, 2022 Author Share Posted September 28, 2022 Updated to 2022.4. It now uses the Alfred Shortcuts Object and checks for the Shortcut in a separate object. Link to comment
vitor Posted January 24, 2023 Author Share Posted January 24, 2023 Updated to 2023.1. Workflow is now distributed via the Alfred Gallery. Download the new version from there or update directly from Alfred.New repository.New icons.New About.Add configurable keyword.Use shortcut even for checking status.Show message to install shortcut inline.Remove OneUpdater in favour of Gallery updating. Due to recent macOS changes, you will need to update the installed shortcut. The workflow will prompt you to do so; overwrite the old one. Link to comment
vitor Posted March 25, 2023 Author Share Posted March 25, 2023 Updated to 2023.3. When defining a time-frame, preview the auto-stop hour. Link to comment
alfredpanda Posted April 3, 2023 Share Posted April 3, 2023 On 3/25/2023 at 10:18 PM, vitor said: Updated to 2023.3. When defining a time-frame, preview the auto-stop hour. Thanks for the on-going updates here - this is still probably my most-used workflow. In the latest update I noticed the time, e.g "Enable until 11:42" - but the time for me is an hour behind. I am in the UK where we're on BST. Is there something I should change here? Thanks! vitor 1 Link to comment
vitor Posted April 3, 2023 Author Share Posted April 3, 2023 @alfredpanda Nothing you need to change. Funnily enough, I remember coding that in the evening of the the DST change and was getting a seemingly wrong result which was in fact correct due to the hour change. Anyway, just released a new update to fix the display. Thank you for the catch. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now