Use of this site is restricted - no Trump supporters, please

Pinned post
I offer this site as a resource and a safe haven for people who have similar interests to mine, and I make no income off this site. I don’t do affiliate links. No paywalls. There are no stupid subscription pop-ups. Just my space to write. It’s a labour of love. But a side effect is that I don’t owe anyone anything. This is particularly true of supporters of Donald Trump. If you voted for Trump, or support Trump, or regularly vote for members of the party formerly known as the U.S. Republican party, but which is now a fascist political enterprise, please just click the back button.

Keyboard Maestro macro to toggle macOS calendar visibility

As a pianist, I use Calendar on macOS and iOS to plan each day’s practice. On heavy days I may have over a dozen practice blocks, so the calendar gets crowded quickly and it becomes easy to miss non-practice events. A calendar that looks like this makes the problem obvious:

What I really wanted was a quick way to toggle a group of calendars at once on macOS. In my case, that group is the set of works I am currently practicing (for example, specific Brahms and Schubert calendars). Your grouping might be completely different, depending on your purpose, but the same approach applies.

Since I am an avid user of Keyboard Maestro, this was my go-to choice to automate it. While Keyboard Maestro macros can contain actions to launch AppleScripts, unfortunately macOS Calendar.app does not have an AppleScript API to toggle calendar visibility. In the AppleScript world this always means that we have to roll out the powerful, but fragile tool of UI scripting. It’s fragile because as Apple or third-party developers change the UI layout, our script is almost guaranteed to break. But in this case, it’s the only way.

Finding the right element to target takes a bit of detective work. The process is made a lot easier with a tool called UI Browser which unwraps the UI hierarchy in AppleScript syntax. Setting the AppleScript target to Calendar.app, we can click through elements progressively, highlighting them along the way until we find exactly the one we want to work with. In this case, the search led to this checkbox:

This checkbox has an AppleScript reference of checkbox 1 of UI element 1 of row 10 of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window "Calendar". This is what we have to click to toggle visibility. The same row contains a text field that we examine to see whether it contains the name of a calendar we want to toggle. From there, it’s just a matter of putting that into a Keyboard Maestro Execute AppleScript action. The script itself is:

--
--   Created by: Alan Duncan
--   Created on: 2026-04-20
--
--   Copyright © 2026 ojisanseiuchi.com, All Rights Reserved
--

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

set calendarsToToggle to {"Brahms I", "Brahms II", "Brahms III", ¬
   "Brahms IV", "Schubert I", "Schubert IV"}

tell application "Calendar" to activate

tell application "System Events"
   tell process "Calendar"
      -- Using path confirmed by UI Browser
      set splitterGroup to splitter group 1 of splitter group 1 of window "Calendar"
      set sidebarOutline to outline 1 of scroll area 1 of splitterGroup
      set allRows to rows of sidebarOutline
      
      repeat with aRow in allRows
         try
            -- The container where all the calendars live
            set rowContainer to UI element 1 of aRow
            
            -- Pull the name from the text field
            set rowName to value of text field 1 of rowContainer
            
            -- Check for a match and click the checkbox in that same container
            if calendarsToToggle contains rowName then
               click checkbox 1 of rowContainer
            end if
         end try
      end repeat
   end tell
end tell

In Keyboard Maestro I assigned a hot-key trigger of ^P _(P for “Practice”) and scoped it to Calendar.app so that I can quickly show or hide this practice-calendar group.

A script to generate KiCad board outlines

PCB fabricators require a board outline on the `Edge.Cuts` layer to specify the board size and shape. While drawing the board outline in the PCB editor is straightforward and uses the standard line and shape drawing tools, it is convenient to retain standardized board outlines and related parts, such as fasteners, as reusable footprints. During the board layout process, you can simply plop a board outline, along with perfectly-placed mounting holes into the editor and you can concentrate on the placing components and routing. Also, having a standard library of board outlines gives you a predictable set of size choices for enclosures and for ordering SMD stencils.

This is why I created KiCadBoardOutlineGenerator, a script to generate board outlines from dimensions you specify.

Indigo actions are not guaranteed to execute sequentially

Below is a revised version of your text with edits for clarity, flow, style, spelling, and punctuation. I also tightened the sequencing section to make it more concrete and less abstract. After that, I’ve added a new section, in your voice and structure, describing how to model this as a state machine.


Although I’ve used Indigo — the macOS home automation ecosystem — for over a decade, I never picked up on the fact that Actions attached to Schedules, Triggers, and web UI elements are not executed sequentially. The application user interface strongly implies sequential execution, but not only is that not guaranteed, the app actually attempts to execute the actions in parallel.

GPIO initialization on the ESP32 in ESP-IDF

This is just a quick post on how not to initialize a GPIO in ESP-IDF. A tutorial on Embedded Explorer discusses GPIO use in ESP-IDF and suggests initialization in this way:

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"

#define LED_PIN     GPIO_NUM_32
#define BUTTON_PIN  GPIO_NUM_36

void app_main(void)
{
   gpio_set_direction(LED_PIN, GPIO_MODE_OUTPUT);   
   gpio_set_direction(BUTTON_PIN, GPIO_MODE_INPUT);
   
   while(1) {       
      if (gpio_get_level(BUTTON_PIN) == 0) {  // If button is pressed
         gpio_set_level(LED_PIN, 1);         // Turn the LED on
      } else {
         gpio_set_level(LED_PIN, 0);         // Turn the LED off
      }
      
      vTaskDelay(1); // Add 1 tick delay (10 ms) so that current task does not starve idle task and trigger watchdog timer
   }
}

This of course works, but I wanted to clear up matters because I think this takes some major shortcuts. Here is what I would suggest instead:

Removing Stuck Filament from the Bambu AMS 2

3dp
The Bambu AMS 2 Automatic Material System is a peripheral unit that provides multi-filament selection and feed management for several Bambu Lab FDM printers. I use it with a P2S printer and have generally been satisfied with its operation. However, as with any printer, filament breakage does occur. Because filament in the AMS 2 is routed through a complex network of PTFE tubes, drive gears, and internal manifolds, removing broken fragments can be substantially more difficult than on single-extruder systems.

Scripting Shelly relay devices in Indigo

This is a proof-of-concept for scripting Shelly relay devices in an Indigo Python action.

I’ve used the Indigo macOS home automation software for many years. It’s a deep, extensible and reliable piece of software. Among the extensible features of the application is its suite of community-supported plugins. There is a plugin for Shelly devices, but it supports only earlier devices and not the current units. As I understand it, the author does not intend to update the plugin. In this post, I’ll show a method for controlling these devices without plugins. The shortcoming here is that the Shelly device doesn’t have a corresponding Indigo device, and everything is handled through action groups and variables.

Some thoughts on the Charlie Kirk Assassination

Until this month, I’m not sure I had heard of Charlie Kirk. Now the entire world has.

First of all, to any MAGA people reading this: No one on the progressive side wanted to see this man dead. That actions of the alleged murderer were his alone and don’t represent the views of practically anyone on the Left. So stop pretending otherwise. You’re not helping. The gunman’s motives are poorly understood and much more evidence must be collected in order to understand his political ideology. I’m not even sure he has a coherent philosophy. So attempts to reduce this to some vast left-wing political conspiracy is a ridiculous cognitive shortcut.

Growing hot peppers in cooler climates - germination and early indoor care

rxmslp

Growing Capsicum sp. in general is a challenge in cooler climates because these are all relatively long growing season plants. Hot peppers, particularly certain varieties, present an especially complicated challenge because their growing season greatly exceeds the number of suitable days available. I live in Ontario, Canada, and without many weeks of indoor preparation, growing my beloved hot peppers would be impossible. Instead, with some planning and preparation, we can grow exotic varieties like the RXM SLP shown in this post.