Tuesday, October 25

I’ve been getting back into the exciting world of desktop Linux cat vacuuming yak shaving lately. (I never completely leave, but I guess the intensity of my presence varies.)

I’m not exactly sure when I crossed this threshold, but a while back I became the sort of person who cultivates dotfiles in earnest. I suppose what it amounts to is that I’ve been using a lot of the same software for years (and maybe decades by now). The customizations pile up.

I used to flit around all over the place, soaking up the novelty and variation, fascinated by all sorts of weird little evolutionary niches in interface and capability. I used to jump between DOS and Windows and Debian and Actual Antiquated Unix and Apple’s System (7|8|9) and whatever whacky demo you could boot off a floppy. The thing I miss most about old-school Debian is how there was just a menu for switching to a different window manager mid-session, which for some reason I spent hours doing.

Now: the first mention of XMonad on this blog is 2009; Vim is 1999. I’ve probably been on IRC for the majority of the time since 1996. If my software habits were human, some of them could be voting against Donald Trump in a presidential election.

Anyway, in keeping with all those yak clippings and my recent fixation on note-taking, I started a tiny project this evening: commandlog will be a handful of tools for accumulating command-line history with context, grouping them, and making notes about them. My hope is that eventually I can turn all my haphazard, undocumented shell time into a cumulative, re-usable log of different tasks and techniques. It seems to me like there should be a natural flow from doing some set of operations in the shell to building a reusable script.

My first couple of gestures at this were a lot simpler: I set the length of shell history to something ridiculously long, and added a comment command that was just a no-op for sticking things in history, so I could say:

$ frobnicate /dev/intangentializer
$ man frobnicate
$ apropos frobnicate
$ man frob
$ frob -i /dev/intangentializer
$ comment "trying to figure out frobnication of external devices"

…and then later grep for that sort of thing. (It is probably worth noting that these are made up commands.) It works ok as far as it goes, but it’s often lacking the context you’d want. (I can’t for the life of me remember why I didn’t just use # for comments, but I feel like there was some reason.)

commandlog is a touch heavier: It drops the command, along with context data like working directory, host, user, time, and current shell, into an SQLite database.

It probably isn’t ready for general use yet, but it won’t take much to get it there. I think the interesting pieces will probably come from search, grouping or tagging commands, and a notes system.

tags: topics/commandlog, topics/debian, topics/linux, topics/notes, topics/perl, topics/technical, topics/warelogging, topics/xmonad

p1k3 / 2016 / 10 / 25