Image of the glider from the Game of Life by John Conway
Skip to content

Pimp My Irssi - Part 2

It's been over 3 years since I wrote the original article about pimping out Irssi, with various themes, scripts, aliases, etc. Well, I figure it's probably time for an update. After all, if you know anything about me, you know I'm an IRC junkie with Irssi, and currently having a love affair with Bitlbee.

Aliases
I've only added two aliases to Irssi since we've last met. The first alias comes from the main Irssi.org website. If you scroll to the bottom of the page, there is a tip close to the end for adding all open channels to your "/channel list". The only thing it was missing was saving the window layout to the config, so next time you open your Irssi, not only will you be rejoined to all of your channels, but they'll all be in the same place they were last time. Here's the alias:

/alias CHANNADD script exec foreach my \$channel (Irssi::channels()) { Irssi::command("channel add -auto \$channel->{name} \$channel->{server}->{tag} \$channel->{key}")\;}; layout save; save

This next alias will effectively "mark all as read" for your channels. For whatever reason, you may like to have a clean slate for channel activity in your statusbar, rather than all the channels showing some form of activity. This alias will clean up your statusbar, so any new activity becomes immediately available. As mentioned, think of this as "marking all channels as read":

/alias READ script exec \$_->activity(0) for Irssi::windows

Scripts
My scripts have changed a little bit, but not by much. Really, there's only two scripts worth mentioning about that I haven't already done so in the previous post.

The first script is similar to "screen_away.pl", except for tmux(1). I've adopted nesting Irssi behind tmux(1) instead of screen(1) because I just couldn't get bolded black and white to work correctly. Now, everything looks as it should, with zero formatting issues. At any event, "tmux_away.pl" does the same thing, in that it sets your "/away" status when you detach your session, and resets it when you reattach.

The second script is "trigger.pl". This script is mostly a search/replace script for events that happen in the channel. For example, if you don't like the "F-word", you can change it to something less vulgar with trigger.pl. It can handle much more, but I only use it mainly for that purpose. The triggers I've set up this far are as follows:

-publics -regexp 'Message from unknown participant ' -replace ''
-all -nocase -regexp '</?(a|b|body|div|em|font|i|s|u)( +\w+=".*?")*>' -replace ''
-privmsgs -nocase -regexp '&amp;' -replace '&'
-privmsgs -nocase -regexp '&gt;' -replace '>'
-privmsgs -nocase -regexp '&lt;' -replace '<' -privmsgs -nocase -regexp '&quot;' -replace '"' -publics -masks 'update!update@identi.ca' -channels '&bitlbee' -regexp '^aaron: ' -replace ''

All of my triggers are Bitlbee triggers. Let's cover each trigger that I've created, just so there's no confusion:

  1. When joining Jabber MUCs with Bitlbee, the Jabber server you're connecting to can be configured to print the past 20 lines (or whatever) of the previous log, so you can get caught up to speed on the discussion quickly. However, if the user that said something in that log is not in the MUC when you join, you'll see "Message from unknown participant" in the backlog. This trigger removes that completely.
  2. When Pidgin or Adium users get online, sometimes the clients send HTML/XML to Bitlbee. THis trigger strips the HTML/XML tags as listed completely.
  3. Similar to trigger #2, this trigger replaces the HTML "&amp;" with "&";
  4. Similar to trigger #2, this trigger replaces the HTML "&gt;" with ">";
  5. Similar to trigger #2, this trigger replaces the HTML "&lt;" with "<";
  6. Similar to trigger #2, this trigger replaces the HTML "&quot;" with '"';
  7. I use Identi.ca with the XMPP bot in the "&bitlbee" channel. I know the bot is addressing everything to me, so I don't want to see each notice begin with "aaron: ", so I've stripped that out completely, so the notice actually starts with the user nickname. If you're interfacing with the bot in a private channel, rather than in "&bitlbee", then this trigger won't do much good for you. You'll need to modify it.

Theme
As much as I try to do a new theme, I always come back to my custom-built "madcow.theme" called "88_madcows.theme". It's the awesome. Screenshot

{ 2 } Comments