Welcome to the lab.

Git better with fzf and Fish

You’ve probably heard me mention fzf before. It’s an amazing command line tool created by Junegunn Choi. It takes a list of data and turns it into a command line menu with fuzzy searching, multi-select, and can even preview each item in whatever way is appropriate. I’ve been using it in all kinds of scripts — where I used to have rudimentary numbered menus, I now have much friendlier and more flexible terminal navigation.

fzf is available via Homebrew, just run brew install fzf. See man fzf for very good documentation.

One great example of how fzf can change your command line life is the set of keybindings for git shared by the author. With these set up you can, for example, start typing a git command that requires a commit hash, hit Ctrl-G Ctrl-H, and get a searchable menu of all your commits. Select the one you’re looking for and the menu closes and the commit’s hash is inserted in your command. It’s crazy handy.

Bunch 1.4.6

Bunch 1.4.6 is out now for automatic update (Bunch->Check for Updates) and for download. It’s been in beta for a couple months, and I’ve added some cool new stuff in the process. See the changelog for a full list of new features, fixes, and improvements.

First, I got a bunch of requests for a feature that would quit all open apps, so I’ve added a (quit everything) command. It will quit all apps that appear in the Dock, leaving menu bar apps alone. You can add exceptions by running (quit everything except iTerm, nvUltra). (It also accepts a variety of syntax such as (kill all) and (burn everything), just for fun.)

I got a couple of special requests for new frontmatter keys. You can now use title prefix: to add a prefix to a Bunch’s menu item title, which is handy because you can apply it to multiple Bunches using folder.frontmatter or @tag.frontmatter. Tag some Bunches with tags: work and then create @work.frontmatter in your Bunch folder containing a title prefix: 💼 and all of your work Bunches will get a briefcase icon before their title in the menu.

There’s also an ignore if: key (with ignore unless: counterpart) that will hide a specific Bunch/folder/tag from the menu based on logic. It can be a UUID string or any logic condition. By the way, all if/unless keys now accept any logic conditions Bunch can handle.

There’s also a couple of new logic conditions: file PATH exists and file PATH contains, which replaces the old trigger file functionality. Now you can perform actions based on whether any file exists, and if it’s a text file, you can test whether it contains a string.

Get the latest version on the downloads page. Enjoy!

Doing 2.0

I’ve pushed Doing 2.0 out to the world. It’s the result of a year or so of tinkering on and off, with some extra love recently, and it comprises enough refactoring, fixes, and improvements to truly warrant the major version bump.

I’ve had a few manic episodes in recent months that have found me obsessively coding on personal projects for hours at a time. I’ve put out new releases of Marked 2 and Bunch, updated multiple open source projects, and spent a ton of time on projects at the day job. So much so that it’s been… (glances at homepage)… a month since I blogged.

I work on myriad projects, but Doing is always the common denominator. No matter what project I find myself hacking away at, I’m constantly tracking my time and progress using Doing. (I even use git commit hooks to add entries to my log whenever I make a commit in one of my projects.) And when I’m in “obsessive coding mode,” every time I use Doing, I think of new things I wish it could do. (Things I wish Doing did? Was doing?) Anyway, a thousand side-tracks to work on Doing have culminated in the first major version bump since its initial release.

To catch you up, Doing is my command line tool for tracking what I’m spending my time on. It has tools for adding entries, tagging them, searching them, tracking time, and outputting reports in various formats. It stores all of this in a plain text file using (slightly proprietary) TaskPaper formatting, easy to port and parse elsewhere.

The project page on this site used to have documentation for all of Doing’s commands and options, but trying to continue fitting it all on one page got very unruly. The documentation has been reorganized and moved to the Doing wiki on GitHub. (If you just want an overview of all possible commands, I did a little RDOC->Markdown conversion to generate an All Commands wiki page.)

There’s so much new stuff that I can’t fit it all into an announcement post like this. Read on for the highlights, though.

If you’d rather play than read, just run gem install doing to get the latest version (2.0.11 as of this writing). Then run doing help to see all available commands, and run doing help COMMAND to get info on each one. I’ve tried to keep it as self-documenting as possible.

Revisiting appinfo: Mac app details from the command line

A few years back I wrote a little script called appinfo to make getting info about an installed application a little simpler (and prettier). It’s served me well over the years. I added a couple of things to it today and figured I’d mention it again.

This script is a lot like doing a Get Info on an app in Finder, just without having to open your Applications folder, or having to expand hidden sections in the info window. Just type appinfo APP_NAME to get instant, pertinent info. One common application is getting the bundle identifier for an app, for use in scripting (or with Bunch).

First, I added an architecture check. Back in 2017 only Intel binaries mattered, so that wasn’t included. Now it will tell you if the app is compiled for Intel, Apple Silicon, or both.

I also added handling for info returned by mdls as arrays, so keys like “Alternate Names” and Architecture can be output in a friendly way. This means you can also add new keys to the script’s config section with abandon.

Just for fun, I added support for chafa (in addition to the existing support for imgcat). If you have one of these installed and your terminal supports it, the app icon will be included in the info output.

That’s it. An update simple simple enough that I actually have time to write about. Unlike what’s happening with doing right now… once I finish the current version of that, I’m going to need a couple hours to detail what I’ve done to it lately.

Check out the script in this gist. Just save it in your path as appinfo and make it executable with chmod a+x appinfo. It takes the name of the app you want info for (must be installed on your machine): e.g. appinfo Preview.

Web Excursions for October 19, 2021

Web excursions brought to you in partnership with CleanMyMac X, all the tools to speed up your Mac, in one app.

BFG Repo-Cleaner
A simpler, faster alternative to git-filter-branch for deleting big files and removing passwords from Git history. I shrunk a 2GB repo to 800 MB in under 10 minutes with this tool. Handy.
kskashyap94/zoom-auto-close
Browser extension to auto close tabs left open by zoom meeting application. Works as advertised.
‎Workona for iPad
Workona is the browser extension (Chrome, Firefox, Edge) I wouldn’t want to be without (I’m still hoping for a Safari version). They now have an iPad app that lets you access all of your workspaces and open tabs from the iPad, and you can add a tab or resource to a workspace from the iOS share button. Very handy. Hope it’s eventually available for iPhone as well…
Between adding this bookmark to the excursion and actually publishing it, Workona has finally started charging for their more “premium” features. Insta-subscribe for me, and hopefully indicates some longevity.
armandino/TxtStyle
There are a bunch of tools for colorizing command line output/log files. This one took the least amount of my day to get it working perfectly with custom log output using a few regular expressions in an easy-to-grok settings file. A++.
Acquiring A Product: Our Kaleidoscope Journey
I’m super excited about the future of what I consider to be the hands-down best Mac diff tool. Newly under the stewardship of some excellent indie mac devs, version 3 is a massive improvement that represents a ton of hard work. Here’s some background on their acquisition of this great app, and a bit of its storied history.

CleanMyMac X

See what you’re “doing” in the iTerm status bar

First of all, there have been some major updates to Doing over the last few weeks (changelog), so be sure to update to the latest version (gem update doing). If you don’t know what Doing is and started reading this post anyway, go check it out first.

I’ve been playing with incorporating Doing into my iTerm status bar. It’s already in my Touch Bar, but having it right below my prompt in my terminal seemed super handy. The method I’m using might seem a bit convoluted, but it’s working great.

This whole thing is based around iTerm’s user variables and interpolated strings. Once set, the variable can be used in status bars, window titles, session badges, etc. You just have to keep it updated, so some hooks are required. Here’s how I got it working.

Just your average project update and wellness check-in

I’ve done a lot of coding in the last two weeks. Playing with projects, adding features, fixing bugs, writing tests. I’ve done a lot of learning Vim (I’m writing this post in Vim, I think I like it). Some day I’ll feel like I’ve learned something in Vim that would actually surprise anybody and I’ll write it up. For now, I’m just playing catch up.

Wellness check

We’ll do this Overtired style, mental health corner at the top of the show…

I had a few manic days last week and am riding out this lull before depression hits. I’ve had depression that wasn’t preceded by mania, but I’ve never had mania that wasn’t followed by depression. Oh, in case you missed it, I’m bipolar. And I’m trying to talk about it more because, well, it’s scary to talk about.

I’m also ADHD, which can be a horrible combination. One symptom of ADHD is hyperfocus, where you can focus on one thing to the exclusion of all others. The problem is, that one thing is almost never the thing that most needs focus at the time. And when I’m manic, hyperfocus goes into overdrive and I have even less control than usual of where it goes.

I actually managed to focus pretty well on day job stuff. Set some impressive precedents that will definitely bite me when the inevitable downturn happens. Hopefully it will be manageable. I gotta get stabled out.

In the meantime, and in addition to doing a great job at work, I updated a bunch of projects. Here’s a rundown.