Welcome to the lab.

BetterTouchTool Touch Bar followup: Zoom buttons

Last week I posted my craziest Mac experiment in a while — a script that handles adding and updating myriad BetterTouchTool Touch Bar (and menu bar) widgets. A couple of days after I posted it, I ended up adding some widgets for Zoom that may actually be the most useful of the bunch.

My day job requires a lot of Zoom meetings. A lot for me, at least, coming from an indie dev world where Zoom meetings were mostly for occasional pandemic gatherings of friends and family. Now I’m in Zoom every day, multiple times a day.

I wanted easy buttons for controlling mic, camera, and sharing without having to focus the Zoom app. Keyboard shortcuts are ok, but they don’t provide visual feedback. So I found a plugin for my Stream Deck that did the trick nicely, letting me control Zoom functions outside the app with indicators for mute, camera, sharing, and even a Leave button for getting out of a meeting in one tap.

Having more to do with my Stream Deck than with the plugin, though, I kept getting communication errors that rendered the buttons useless at inopportune times. It always worked perfectly in testing, but then in an actual Zoom meeting I’d frequently be met with the yellow triangle that indicates plugin communication failure. So I decided to replicate the plugin in my Touch Bar.

Borrowing heavily from the code by Martijn Smit, I created mic, camera, sharing, and leave widgets for BetterTouchTool. These can all be installed and operated by the btt_stats.rb script I posted about last week. And all of the installation and usage information is in the README.

The widgets all show current status of their respective feature, toggle its state, and disappear when no meeting is active. You can even set them up to refresh their display within 1 second, instead of the 4-5 seconds the Stream Deck plugin takes to catch up with changes (owing to BetterTouchTool’s scriptability, not any shortcoming in the original code).

The scripts use Accessibility scripting to click the menu items, so you don’t have to assign shortcut keys. That also means that menu titles are hardcoded, and English-specific. However, I added a whole section to the config file where you can enter the menu titles for a different language and get the buttons to work with just a little translation.

Anyway, just a brief addendum to the craziness. See the original post for more details, and find the whole shebang on GitHub.

Let’s get crazy with BetterTouchTool and Touch Bar Simulator

I’ve recently put some1 time into making a Touch Bar “dashboard” using BetterTouchTool. I know, the first thing you thought when you read that was “but Apple is discontinuing the Touch Bar!” Let me explain. Or try to. I almost didn’t write this post because I was worried it would indicate mental instability of some kind2. But how could I call myself a “Mac Mad Scientist” if things didn’t get a little crazy? We’re all mad here, right?

Brett's Touch Bar

So I had a MacBook Pro with a Touch Bar for a couple of years. I immediately loved the idea of the Touch Bar, made it do a few cool things, and generally appreciated the fact that it was there, offering contextually-relevant and visually identifiable “keys.” Did I actually use it? Not a lot. I had a cool script that made buttons for tasks that howzit could run in the current directory when I was in the terminal, and I used that quite a bit, but other than that, not really.

Howzit tasks in the Touch Bar

90% of the time my MacBook was on a stand next to an external display, being controlled from an external keyboard and trackpad, and the Touch Bar was, at best, inconvenient to reach. I’d stretch to it on the occasions I needed to use Touch ID or run a howzit command, but not for any of the other features it offered. So I didn’t really miss the Touch Bar when I moved over to an M1 Mac mini.

Software mute for XLR mics

Over the last couple of years I’ve spent an upsetting amount of money trying to find a cough button solution for my XLR mic setup. The audio interface I fell in love with (Komplete Audio 6) wasn’t compatible with Shush, the cough button solution I’d used for years with my USB mics. So I started looking at hardware solutions.

The best one I found was the Pro Co Power Mute (after I added a foot switch topper to it). But when I switched to using a Rode Podmic, something about my setup caused the Power Mute to start adding a buzz to the line. No amount of troubleshooting would get rid of it without switching mics, so I ended up continuing my search and settling on a Rolls XLR A/B Switch. You just leave one of the XLR inputs empty and toggle between the hot and empty inputs. It does a fantastic job, and I imagine it will continue to work perfectly even when I inevitably change mics1 and/or audio interfaces in the future. The biggest drawback is that the button takes a significant amount of force to toggle, and thus it makes a better foot switch than a desktop one, which is a bit of a bummer for me2. Nonetheless, with no less than 4 XLR hardware mutes in my arsenal now, I once again had a solid cough button solution.

As fun as a dedicated switch can be, though, I still found I missed the convenience of toggling mute with a keyboard key. I’m afraid I’ve lost track of where this tip came from, but whilst sharing these adventures on social media, it was pointed out to me that Rogue Amoeba’s Loopback could make any audio interface mutable, and thus able to work with USB mic mute solutions like Shush. I ended up switching away from Shush, but I’ll get to that in a second.

Loopback isn’t cheap, but it’s so handy and so powerful that if you’re working with audio — whether streaming, podcasting, producing music, or using audio routing for any reason — it’s worth the investment ($99). And to make your XLR mic mutable with Loopback, all you have to do is create a virtual device with your USB audio interface as the input. That’s it. Keep the default output channels and give the device a unique name.

Now you can just set your microphone input in any app (Skype, Zoom, etc.) to the virtual device. Any USB muting app will be able to cut the input with the press of a button.

The problem I ran into with Shush is that it mutes ALL USB devices, and with the audio routing I have set up, that meant it was also muting my guest on a Skype call. That’s not workable. I tried a few other apps, and the one I landed on is called Mikrofon. It lets you assign a shortcut and select exactly which audio input to mute. The only drawback is that it doesn’t have push-to-mute. It has push-to-talk, but the only other choice is a latching toggle. Which is working out ok, though I’d like to lodge push-to-mute as a feature request.

I have an extra key on my Ultimate Hacking Keyboard (a trackball click on the key cluster thumb module, actually) mapped to toggle Mikrofon, and I get a nice red icon in my menu bar letting me know I’m muted. The button is silent, and there’s no pop or click when muting the channel.

Aside from podcasting, I also use this on Zoom calls, leaving myself unmuted in the Zoom app, and then just controlling my mute with a keyboard shortcut. If I’ve wandered off into another app during a meeting, it makes it easy to unmute myself and respond to somebody without having to switch back to Zoom and find the mute button.

Even at $100, Loopback costs less than the cheapest hardware solutions, plus it can do so much more than just this. If you want to avoid buying a hardware cough button for your XLR mic setup, I recommend checking it out.

  1. Torn between the Sure BETA 87A and the good old SM7B. One way or another, I’ll be changing mics again. 

  2. My desktop converts from a sitting desk to a treadmill desk, and having foot pedals just means more stuff to move around when I want to put the treadmill down. Not impossible, but inconvenient. 

BrettTerpstra.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means to earn fees when linking to Amazon.com and affiliated sites.

A non-slip keyboard tray solution

I asked on Twitter about “rubberizing” my keyboard tray. I didn’t know where to begin solving this problem. I got some very helpful feedback and thought I’d follow up with the solution that worked for me, on the off chance it helps someone else.

I use a 6-way adjustable keyboard tray mounted underneath my NextDesk. My particular model isn’t available right now, but there are others like it. It basically lets me adjust position and angle on three axes, giving me the perfect ergonomic keyboard position whether I’m sitting or standing. And its big enough to hold a trackpad, a split mechanical keyboard, and a 15-key stream deck. And a Shuttle Xpress, though that’s not working for me anymore, with the combination of Big Sur and an M1 Mac mini (I can’t remember which one did it in). In short, I love this keyboard tray, except for one issue: its slick surface tends to let things slide while I’m working with it angled forward to any degree.

So I wanted to make the surface sticky. I didn’t want to get into rubberized paints, but I’d also tried those big gaming mousepads without luck. After trying a few things, I think I found the right solution.

First, I found this roll of non-slip stuff that feels like latex (though is supposed be latex free). It was good and tacky, but it was also shiny and immediately began collecting dust and cat hair. It also was a bit too sticky. I didn’t realize I wanted to be able to move my trackpad a bit as I switched position until it was no longer an option. Then I tried this stuff, which is more like a foam mat, similar to the surface of a standard mouse pad. It was the right amount of sticky, but it wasn’t sticky enough to keep the whole thing from sliding a little over time. I tried a few other things, like kitchen drawer liners, but the perfect solution ended up being a combination of the first two.

The too-sticky, too-shiny stuff made a perfect base for the not-sticky-enough roll of foam stuff. Both easy to cut to size, and the tacky layer is enough to keep the foam from sliding, while giving me the right amount of traction on the top side. Neither one is actually adhesive, so they’re easy to remove and clean when needed. It’s kind of a perfect solution. Both rolls come with enough material to do this a few times over, which I doubt I’ll need to do, but I assume that at some point in the future I’m going to want to make something else less slippery. I’m sure the cost will even out eventually.

Just thought I’d share, especially since the question seemed to get an unusually high response on social media. I’m apparently not alone in this need.

BrettTerpstra.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means to earn fees when linking to Amazon.com and affiliated sites.

Doing (more) with more tags

I’ve added a few new things to my command line time tracker, doing, with an emphasis on adding power to @tagging.

Several commands now accept --tag= as a flag, creating a filter that looks for the last entry (or entries) tagged with a specific tag (or combination of tags). doing last, doing finish, doing again (which is a new command that duplicates a previous task and starts it with a new timer) all accept --tag= to act on a tagged entry rather than the last chronological entry. All commands that accept --tag= also accept --bool=, so you can specify multiple tags separated with commas and then use --bool= to define how they’re combined (AND, OR, or NOT). Run doing help COMMAND (after updating to the latest version, of course) for any of these commands for more details.

The doing last command now accepts -e to edit the last entry in your $EDITOR. Combined with --tag=, you can edit previous entries much more easily. The entry opens in your editor with the title as the top line, and any notes on the following lines. You can update the text, tags, and note, and when you save and close the doing file is updated with the changes.

Most commands that support --tag= also support --search=. This provides fuzzy search for recent entries. If you specify a string, such as doing last --search="Test", the command will search your recent entries for something containing the letters of the string, case insensitive and in order, but separated by up to three characters each. So “Test” would match “the satire.” For doing last, you can add the -e switch to be able to edit the last entry matching a search.

As I mentioned above, doing again (aliased as doing resume) allows you to restart a finished task (as a new task), or end the previous task with the current time and start it again with a new timer. With the --tag= flag, you can now repeat an entry from earlier in the list based on tags. Which means that making liberal use of tags can now be a major benefit beyond just time tracking.

I also added doing cancel, which adds @done tags with no timestamps to recent entries, so no accumulated time is recorded for them. doing cancel also accepts the --tag= flag, so you can cancel the last tagged entry rather than just the most recent entry.

I also added a configuration key called run_after which will execute an arbitrary command or script after any command that modifies the doing file. This ties into a fun BetterTouchTool/Touch Bar/menu bar integration that I’ll write more about soon. You can also now define both editor_app (which is the app that the doing file is opened in with doing open) and config_editor_app (which is the app that doing config will open the configuration file in).

You can update doing using gem update doing. If you want to learn more about exactly what doing is, visit the project page.

Jay Miller: Using Bunch for Creating Newsletters

Jay Miller has published his first video on Bunch. It’s a walkthrough of a Bunch he uses for automating his email newsletter process, and is a great example of Bunch’s usefulness. It highlights some cool Bunch features like embedded snippets and calling Keyboard Maestro URLs, as well as some features that would be considered more “advanced,” such as assigning variables with script results and using variables in conditions.

Thanks to Jay for making this, and I look forward to more in the future!1

YouTube Video
  1. No pressure, though. This is a great video all on its own, and I really do appreciate it. It’s not like I’m paying anybody for this stuff. 

Web Excursions for June 29, 2021

Web excursions brought to you in partnership with MightyDeals.com, featuring great deals on software, training, and design resources.

Running a CPU benchmark on Apple Silicon M1
Peter Forret created a cool bash script that performs a cpu benchmark using ffmpeg and primitive. If you fork the repo and run it, you can commit the results and create a pull request to add them to the repo. Nobody seems to have done it yet (other than me), but I’d be curious to see a few more results from M1 machines, as well as comparisons to Intel machines. Pitch in if you feel the same!
Bookmarklet for Pins.app (1.6+)
A browser bookmarklet for the Pinboard app Pins, which added support for the necessary URL parameters in version 1.6.
Hey, I sped up Apple Mail Rules
AppleScripting the creation of Mail.app Rules is a great tip from Dr. Drang. (Yes, I use MailMate, and my SaneBox @SaneBlackHole covers this particular use case for me, but it’s still a great tip. Also, yes, the persistent emails of the type Dr. Drang describes are super annoying.)
Surge
A service that will host your static website with a CLI that makes publishing a one-step process. Support for SSL, custom CNAME, custom 404s, and more. It’s kind of insane that this is free.
Sync Safari Reading List bookmarks to Pinboard
Samuel Kordik built on work from Zach Fine and updated my old Reading List Catcher script to work in these modern times. It’s a Python script that syncs your Safari Reading List to Pinboard (and a Markdown file, to boot). You need to add a “secrets.py” file with your API key, and install the pinboard and pytz packages, but other than that it “works right out of the box.”