Skip to main content

Baty.net

A blog about everything by Jack Baty 👋

Category: Software

Zoxide and Fish Shell

I’m happy using Fish for my shell. One thing I’d not gotten around to after switching is finding a good directory jumper. The original z doesn’t work well with Fish. I used to use fasd and autojump, but thought I’d look around for something new.

For some reason, I’d never heard of zoxide: A smarter cd command. Combined with zoxide.fish: Tab completion and initialization for zoxide in fish shell, zoxide does the job nicely.

Bringing Apple Passwords into Pass

I have a soft spot for Pass: The Standard Unix Password Manager, but Apple’s new Passwords app has been working fine. I use Safari, so the whole thing is very convenient. 

Sometimes I get twitchy about having things in only one place, so today I decided I’d like to import my Apple Password passwords into Pass. It took me a minute, so I’m jotting down some notes here, for next time.

An email fiasco

All I wanted was to use notmuch on my MBP to manage email, just like I do on my Mac Mini. The only viable solution I found was muchsync. There’s no macOS installer for it1, so I figured I’d compile it myself. 

A few years ago I promised myself that if something required ./configure && make && make install I would skip it. Well, I really wanted to try it, so off I went. The make command failed immediately because it couldn’t find notmuch.h. Great, path problems. After an hour of throwing things at the wall, adding some environment variables worked:

Adding weather to my Fish welcome message

Fish shell welcome message showing weather conditions

Fish shell welcome message showing weather conditions

For some reason, I always want to know the weather conditions. I barely go outdoors, but I still like to know what’s happening. I have a few shell scripts that kick out some version of the weather. Here’s the one I use most:

    #!/bin/sh
    # Jack Baty, 2023 (https://baty.net)
    # Grab and parse weather info using WeatherAPI.com
    
    jq=/opt/homebrew/bin/jq
    
    # Save the response to temporary file
    # TODO: shouldn't this just be a variable or something instead?
    weatherfile=`mktemp`
    curl -s "https://api.weatherapi.com/v1/forecast.json?key=[SNIP]&q=49301&days=1&aqi=no&alerts=no" > $weatherfile
    
    now=`${jq} -r .current.condition.text ${weatherfile}`
    temp=`${jq} -r .current.temp_f ${weatherfile}`
    condition=`${jq} -r .forecast.forecastday[0].day.condition.text ${weatherfile}`
    high=`${jq} -r .forecast.forecastday[0].day.maxtemp_f ${weatherfile}`
    low=`${jq} -r .forecast.forecastday[0].day.mintemp_f ${weatherfile}`
    
    echo "${now} ${temp} | Low ${low}, High ${high}"

Right now, this returns: Light snow 21.9 | Low 20.1, High 26.4

GoAccess and HTTP Protocols

Using GoAccess to process my web server logs is going fine. It’s nice not paying for an analytics service, but it’s definitely a messier process.

I wrote a little about Filtering server logs for use with GoAccess recently, but have since tweaked things a little.

One thing I found annoying was that GoAccess reports requests separated by HTTP protocol. So HTTP2 and HTTP1.1 requests are counted separately. Not what I wanted, so I discovered --http-protocol no and --http-method no. I’m always going to want this, so I added the following to /etc/goaccess/goaccess.config

Trying Ghostty

Ghostty is a new, platform-native terminal app from Mitchell Hashimoto. I’ve been alternating between Ghostty and Apple’s Terminal for about a week.

I like Ghostty. It feels nice right out of the box. Configuration is done via a simple text file, but almost no configuration is necessary. Sensible defaults always make a good first impression, and Ghostty makes a really good first impression.

Most of the early reviews I’ve read begin with raves about how fast Ghostty is. Is it that fast, though? It’s pretty fast, actually, but it’s not noticeably faster on my Mac than Apple’s Terminal. I keep comparing the two, and I find no meaningful difference in speed for anything I do with a terminal. It’s not slower than Terminal, certainly, but I suspect that all this talk about speed is partially because we like new things and because everyone else says it’s fast. We’re an impressionable lot 😀.

Blogging with Curio

I’ve used Zengobi’s Curio for many years when I needed a visual system for managing projects and associated files. In a recent version, Curio gained a Journal feature. It’s fairly rudimentary compared to dedicated journal apps, but I recently started testing it as a way to create a sort of scrapbook each day. It works pretty well for that. I export a PDF of the day’s entry, print it, and put it in a binder.