🏠 Go home.

Reordering Irssi Windows for Fun and Profit

Published on

A large part of my day is spent using IRC – my company uses IRC to communicate with the various subsidiaries across the country, and almost all of my friends talk to me in various IRC channels.

Altogether, I spend a huge amount of time and productivity on IRC. To help manage all of this, I use irssi sitting on this server and have become pretty good at managing activity in various channels and filtering the rest of it. However, unlike Vim and the rest of my toolkit, I haven't invested a lot of time in making it as productive as I could. For example, I've accrued nearly 100 windows that I actually use in my week or month, and tons that I don't actually need any more.

Furthermore, the order that I've joined channels doesn't really represent the priority in which I use them, which is a problem I felt like I could actually solve. After all, we only have 20 quick access key bindings (Alt-1 to Alt-0 and Alt-Q to Alt-O), so anything beyond that you have to /win (or /w if you have it aliased like I do) to access.

My reasoning was that the channels I talk in are the ones that I care about the most, and did some tests. I dumped the list of windows I had open using the reorder script and wrote a quick oneliner in bash found which channels I care the most about. It turns out that "how often I talk" is a really good heuristic of how much I care about that channel.

So I set out to build a script that would munge that would sort the output of that reorder script, and decided that I would explore Bash by writing it solely in bash and using tools from the standard UNIX toolkit. I managed to finish the script using only sed, awk, grep and sort, and I could very easily combine the usage of sed and awk. The standard UNIX toolkit is an incredibly powerful tool for programming, and I really enjoy working inside of the environment.

The end result was the start of me resharpening my BASH scripting skills and a nice script on the gifhubs that I can run whenever I need feel like my windows are out of sorts.

Respond to this note:

Ryan Rix is a computer infrastructure fanboy who dabbles in decentralized systems. Reach him on twitter as @rrrrrrrix, via email to ryan@whatthefuck.computer or on Facebook or on Matrix as @rrix:kickass.systems.