When a Geek Tries to Sleep

Once when I’m about to take a nap I thought to myself; “Wouldn’t it be great if the Do Not Disturb mode is active as long as the timer I set? That will solve the problem of people contacting me while I’m taking a nap.”

I expect the programming will be straight forward. I can simply pass the number of minutes to both Timer and Do Not Disturb. Turns out that Do Not Disturb can’t accept number of minutes and need to specify a specific time to get out of the mode.

The alternative is to program a Wait and then turn off Do Not Disturb. Problem is Wait need input in seconds instead of minutes. Thus I added another operation to do that conversion.

Here’s the recipe so you can refer to and build on. If you just want to use as it is, download the script here.

On the side note: I wonder whether I’ll recover the 20 minutes to program this. A comic by XKCD perfectly illustrates this.

The time saved with the script is roughly 20 seconds per use. Coding time is 1200 seconds. Thus I need to use this script 60 times to break even. Since I’m using this almost daily during work days this is a rather profitable trade.