💾 Archived View for lyk.so › gemlog › 008-searching-the-bins.gmi captured on 2023-05-24 at 17:41:41. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-03-01)
-=-=-=-=-=-=-
I keep a lot of my things tagged with identifiers and stashed away in bins. To keep track of which bins hold which things, I keep a set of TSV files matching identifiers to bins, item descriptions, and other category-specific fields.
Until today, whenever I needed to locate an item I'd pull up a terminal, navigate to my inventory directory, and run "grep -ri 'some item'". It worked well enough, but I've been wanting to explore what could be done to streamline my workflow using tools like fuzzel and fzf for a while now. Searching my inventory interactively seemed like a natural fit for fzf.
fzf is a "command-line fuzzy finder." It takes some input from stdin, provides an interactive text-based interface for searching through it, and outputs the user's final selection to stdout. It also has a "preview" flag, which takes a command string to be executed on the user's current selection and presents the output in a preview pane alongside the search interface.
I was able to combine this flag with a script that pretty-prints an inventory entry to create a simple command-line interface for exploring my inventory entries. I bound this to a hotkey in sway, and now I can look up anything in my inventory with just a few keystrokes! 😁