Search results

From the blog

Posted 2024-10-21
Wezterm GUI Notifications

Wezterm has a utility for raising GUI system notifications, window:toast_notification(), which is a handy way to bring notifications to you that you might otherwise miss if the window is hidden or if a given tab is inactive.

However, on Linux, it's a far from ideal tool, at least under gnome-shell. (I don't know how it does on KDE or other desktop environments.) It raises the notification, but the notification never times out, even if you provide a timeout value (fourth argument to the function). This means that you have to manually dismiss the notification, which can be annoying, particularly if the notifications happen regularly.

So, I worked up my own utility.

/postroll

gron

github.com

gron is a tool for working with JSON. It chunks things into key-value pairs where the key is a dot-separated hierarchy. This allows you then to use grep or ack to search for strings of interest.

It can also reassemble these back into JSON. This can be useful for adding or removing portions of a JSON structure. It becomes really interesting then when you pair it with jq in order to retrieve data back out.

As an example, I can get the list of development requirements from a composer.json with the following:

gron composer.json | ack "require-dev" | gron -u | jq '."require-dev" | keys[]'

(They'll still be in quotes, but that's easier to deal with than JSON keys!)

/postroll

Finding Terminal Utopia

www.daveyshafik.com

Davey does a stellar job here of detailing a number of different tools he uses to cobble together an optimal terminal experience for himself. I personally found starship, eza, and fd to be great finds, and have incorporated them in my own terminal setup.

Search tips

  • Use #{some tag} or tag:{some tag} to filter by tag; using this more than once will find results that match all tags.
  • Use year:{year} to filter by year. If you use this multiple times, the last one wins.
  • Use begin:{year-month-day} to restrict to results beginning on that day. Last one wins.
  • Use end:{year-month-day} to restrict to results ending on that day. Last one wins.