A Fully Automated Home Office DND Solution

It was almost two years ago when I created a custom “Do Not Disturb” button for my home office that allowed me to tell my family that I’m in a meeting and please don’t casually pop in. I wrote a post about it, but the up shot is that I cobbled together some parts I had around, 3D printed a case, and wrote some code that so that the button, connected via USB to my computer, would act as a keyboard and fire a keyboard shortcut. That keyboard shortcut would then trigger a bash script that turned on a red light outside my door.


Well…all of that is fully automated now. There is no button. The button is in all of us. We are all the button.

Let’s talk about this new automated system I made this weekend.

The old DND button.

Anyone who’s been reading my recent posts won’t be surprised with the foundational pieces of the new automated solution: Keyboard Maestro and my Stream Deck. My solution was heavily inspired by TJ Luoma’s setup described on GitHub two years ago, and my goals were to build off of his Stream Deck display to give myself the same glanceable info on my next meeting, simplify the setup, and add the hooks to automate turning my DND red light on and off automatically when my meetings start and end.

TJ’s solution is based on iCalBuddy (note), eight KM macros, and two external bash scripts, which he uses to setup his Stream Deck to show a button that always shows when the next meting is and changes color as your next meeting gets closer. My solution does that the same and uses iCalBuddy (TJ’s same iCalBuddy version), but no external scripts, and only two KM macros:

  1. A KM macro that runs every minute and updates a button of your choosing with when the next meeting starts.
  2. The other KM macro just opens Fantastical when you press the same configured button.

(Note: Because I’m sharing this macro logic across two computers with two Stream Decks I also have KM macros that set the button ID and then fire the #1 macro. I’m not including those macros here though as most people do not need that level of abstraction.)

This simplification is important as I have two Macs that I want this solution to be usable and synced between both of them. I also added the logic to integrate with my home automation system (Home Assistant) to turn my red DND light on or off. As a part of that logic, I also added a global variable that says to all KM macros whether or not I’m currently in a meeting and I think that could be really helpful to add to other macros in the future. For example, any automation that makes sounds or pops messages can now know that I’m in a meeting and avoid taking any actions that would disturb the meeting.

I haven’t had this solution in place for long, but I love it. It’s sounds crazy, but yes, even just having to hit a button is something that I would frequently forget and now the DND light turns on immediately when the meeting starts and off at the end.

There are edge cases that I may or may not deal with at some point. For example, automatically turning off the DND light at the end of a scheduled meeting time might prove to be annoying if meetings run over frequently. Another potential issue is that not all “meetings” need the DND light, such as a lunch or doctor’s appointment where I’m not in my office. I could deal with that by ensuring those are on a separate calendar that I don’t track with iCalBuddy, or by adding a flag in the title that my automations can look for and utilize. It may not be worth the trouble though.

The old button is now free to be disassembled for future projects. The DND button is dead. Love live the DND button!

Here is a link to an exported copy of the KM macro that includes all of the button display logic and below is a screenshot of the macro if you wanted to just get a sense of how it works.

Related Posts

A Decade of Clojure at Studio71

  • Mike
  • March 30, 2023

What is Clojure and why did it fit for Studio71? Clojure is a programming language (a dialect of Lisp) that excels at concurrency and data processing. Clojure runs on top of Java so it’s runs in all of the places Java runs and can use all of the Java libraries already out there (hello, Google and AWS libraries!

Read more

The macOS Privacy Settings Deleted My Backups

  • Mike
  • February 13, 2023

The other day I logged in to my NAS to find that all of my backed up media files were gone. No errors, the drives were fine, the directory was there, but the files were gone. Thankfully it wasn’t a freak out moment as I had my originals and my other backups, but it was a mystery.

Read more

Building a Mastodon Client in to my Cyberpunk SSH App

  • Mike
  • February 3, 2023

Let me quickly get you up to speed: I wanted to build a website for my hacker projects, but instead of a website I ended up building an SSH app (because I’m weird). Basically, instead of visiting it in your web browser you have to open your terminal, run an SSH command, and then you use text commands to play with the application, read about my projects, etc.

Read more