![]() Next, the POMODORO_LOOPS variable is decreased by 1 to indicate that a run has passed. Important to note here is that this is also the reason the "Execute Macro" action in "Update" was called asynchronously if not, "Stop" would be seen as a child of the "Update" instance, meaning it'd cancel itself. As described, this is in case the Pomodoro is stopped prematurely through the menu bar item. In the "Logic" group, first the earlier saved macro instance is canceled. Those actions outside are again up to the user to allow for customization. Similarly to the "Start" macro, this contains a "Logic" group and a few actions outside of the group. If the result is 0 the run the " stopped" is triggered, and otherwise it goes back to the beginning of the repeating group. Once the minute has passed, I decrease the POMODORO_REMAINING by 1. I initially had this macro set up with the "Periodic Trigger", but since that executes every minute on the minute it didn't ensure an accurate timing. First it sets the title, and then it pauses for 1 minute. The POMODORO_REMAINING number is then used to repeat a group of actions n times. ![]() This is later used to cancel that specific instance, which is needed in case a Pomodoro is stopped mid run. ![]() The first action saves the ID of the macro instance. I then enable the "Stop" macro and disable the "Start" macro, which ensures that only one of them will ever be visible in the menu bar menu: "Start" when no Pomodoro is running, and "Stop" otherwise (see also my approach to starting and stopping modes). This is used to keep track of the Pomodoro progress. In the second "Logic" group I use the configured duration to set the time remaining ( POMODORO_REMAINING). While the prompt is open Enter will start the Pomodoro and Escape will close the prompt and cancel the macro. I deliberately placed the Local Loops input first, since it seemed more likely to be customized than the duration. In the first "Logic" group it first prompts for input, allowing configuration of the number of loops and the duration of each Pomodoro. The reason of grouping actions together in those "Logic" groups is purely to make it easier to indicate what's actually necessary for the functionality and where to add in custom actions. Those macros in between are up to the user, and aren't strictly necessary-they just allow for initiating anything else when starting a Pomodoro. The "Start" macro contains two groups called "Logic" with some actions in between. Noteįor custom icons you can download Apple's SF Symbols ↗ for free, which is the same set of icons that have just been added to Keyboard Maestro itself. It has no icon, since I prefer to set that through text as well to have them display nicely in the same color. The macro group contains four individual macros, and is set to display in the menu bar with a title from the variable POMODORO_TITLE. This part is really up to the user, but having it together with my other macros like this offers a lot of flexibility. For example, when a Pomodoro starts it turns on Do Not Disturb and turns my desk light red, and at the end of a Pomodoro it resets both. Since this is all done with Keyboard Maestro I can easily hook in any of my other macros. In between Pomodoros, the menu bar will show that you're on a break.Īfter the break interval, steps 3–4 are repeated, until there are no more loops remaining. Starting a Pomodoro will show the remaining time in the menu bar. This defaults to 4 loops of 25 minutes, meaning that it covers a period of 2 hours. #BehaviorĪt rest, there's an item in the menu bar to open up a menu for starting a Pomodoro.Ĭlicking the menu item lets me configure the next Pomodoro run: how many loops there should be, and how long each Pomodoro should last. On the one hand for the reasons mentioned in the introduction, and on the other hand for the deep integration it provides me with my other macros. There are plenty of dedicated apps for this, but I wanted to do it with just Keyboard Maestro. Normally it's a 25-minute period of work followed by 5 minutes of break, which can then be repeated multiple times. The Pomodoro technique ↗ is a time management method that has you alternate between periods of focus and short breaks. The rest of the post will go into detail about the steps and the logic behind it, but the complete macro group can be downloaded from the conclusion. I decided to build out a minimal Pomodoro app around these features-partially for the learning experience, and partially at the request of my wife. Since then I've been playing around with some of their new features, and there are two in particular I found interesting: the ability to create subroutines ↗ and the ability to show macro groups in the menu bar ↗. That update inspired me to hurry up and get my post on desktop productivity out, which covers a lot of my Keyboard Maestro setup. This week Keyboard Maestro released v10.0 ↗.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |