Jump to content

Irssi: Difference between revisions

7,903 bytes added ,  22 July 2009
no edit summary
No edit summary
No edit summary
Line 29: Line 29:


There are lots of themes on the [http://www.irssi.org/themes irssi homepage], some better than others. The themes are written in plain text, so if you find a well written example they're pretty easy to change around slightly.
There are lots of themes on the [http://www.irssi.org/themes irssi homepage], some better than others. The themes are written in plain text, so if you find a well written example they're pretty easy to change around slightly.
== Configuration file ==
The easy way to enter chat is with the alias "chat" - this runs irssi with a default Redbrick config.
This is fine for a while, but it's nice to personalise things a little and to do this you can edit your ~/.irssi/config file.
Every time you type "irssi" it will start with this configuration file by default.
Here's an basic file to get you started:
servers = (
  {
    address = "irc.redbrick.dcu.ie";
    chatnet = "RedBrick";
    port = "6667";
    autoconnect = "yes"; },
);
chatnets = {
  RedBrick =
  {
    type = "IRC";
        autosendcmd = "/msg chanserv identify <password>";
  };
};
channels = (
  { name = "#lobby"; chatnet = "RedBrick"; autojoin = "yes"; },
  { name = "#mychannel"; chatnet = "RedBrick"; autojoin = "yes"; },
);
aliases = {
  J = "join";
  WJOIN = "join -window";
  WQUERY = "query -window";
  LEAVE = "part";
  BYE = "quit";
  EXIT = "quit";
  SIGNOFF = "quit";
  DESCRIBE = "action";
  DATE = "time";
  HOST = "userhost";
  LAST = "lastlog";
  SAY = "msg *";
  WI = "whois";
  WII = "whois $0 $0";
  WW = "whowas";
  W = "who";
  N = "names";
  M = "msg";
  T = "topic";
  C = "clear";
  CL = "clear";
  K = "kick";
  KB = "kickban";
  KN = "knockout";
  BANS = "ban";
  B = "ban";
  MUB = "unban *";
  UB = "unban";
  IG = "ignore";
  UNIG = "unignore";
  SB = "scrollback";
  UMODE = "mode $N";
  WC = "window close";
  WN = "window new hide";
  SV = "say Irssi $J ($V) - http://irssi.org/";
  GOTO = "sb goto";
  CHAT = "dcc chat";
  RUN = "SCRIPT LOAD";
  UPTIME = "eval exec - expr `date +%s` - \\$F | awk '{print \"Irssi uptime: \"int(\\\\\\$1/3600/24)\"d \"int (\\\\\\$1/3600%24)\"h \"int(\\\\\\$1/60%60)\"m \"int(\\\\\\$1%60)\"s\" }'";
  CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not  found\\; fi";
  SBAR = "STATUSBAR";
  INVITELIST = "mode $C +I";
};
statusbar = {
  # formats:
  # when using {templates}, the template is shown only if it's argument isn't
  # empty unless no argument is given. for example {sb} is printed always,
  # but {sb $T} is printed only if $T isn't empty.
  items = {
    # start/end text in statusbars
    barstart = "{sbstart}";
    barend = "{sbend}";
    # treated "normally", you could change the time/user name to whatever
    time = "{sb $Z}";
    user = "{sb $cumode$N{sbmode $usermode}{sbaway $A}}";
    # treated specially .. window is printed with non-empty windows,
    # window_empty is printed with empty windows
    window = "{sb $winref:$T{sbmode $M}}";
    window_empty = "{sb $winref{sbservertag $tag}}";
    prompt = "{prompt $[.15]T}";
    prompt_empty = "{prompt $winname}";
    topic = " $topic";
    topic_empty = " Irssi v$J - http://irssi.org/help/";
    # all of these treated specially, they're only displayed when needed
    lag = "{sb Lag: $0-}";
    act = "{sb Act: $0-}";
    more = "-- more --";
  };
  # there's two type of statusbars. root statusbars are either at the top
  # of the screen or at the bottom of the screen. window statusbars are at
  # the top/bottom of each split window in screen.
  default = {
    # the "default statusbar" to be displayed at the bottom of the window.
    # contains all the normal items.
    window = {
      disabled = "no";
      # window, root
      type = "window";
      # top, bottom
      placement = "bottom";
      # number
      position = "1";
      # active, inactive, always
      visible = "active";
      # list of items in statusbar in the display order
      items = {
        barstart = { priority = "100"; };
        time = { };
        user = { };
        window = { };
        window_empty = { };
        lag = { priority = "-1"; };
        act = { priority = "10"; };
        more = { priority = "-1"; alignment = "right"; };
        barend = { priority = "100"; alignment = "right"; };
      };
    };
    # statusbar to use in inactive split windows
    window_inact = {
      type = "window";
      placement = "bottom";
      position = "1";
      visible = "inactive";
      items = {
        barstart = { priority = "100"; };
        window = { };
        window_empty = { };
        more = { priority = "-1"; alignment = "right"; };
        barend = { priority = "100"; alignment = "right"; };
      };
    };
    # we treat input line as yet another statusbar :) It's possible to
    # add other items before or after the input line item.
    prompt = {
      type = "root";
      placement = "bottom";
      # we want to be at the bottom always
      position = "100";
      visible = "always";
      items = {
        prompt = { priority = "-1"; };
        prompt_empty = { priority = "-1"; };
        # treated specially, this is the real input line.
        input = { priority = "10"; };
      };
    };
    # topicbar
    topic = {
      type = "root";
      placement = "top";
      position = "1";
      visible = "always";
      items = {
        barstart = { priority = "100"; };
        topic = { };
        topic_empty = { };
        barend = { priority = "100"; alignment = "right"; };
      };
    };
  };
};
#THIS SECTION DEALS WITH SETTINGS SUCH AS YOUR NAME AND TIMESTAMP FORMAT
settings = {
  core = {
    real_name = "Newb McNewberton";
    user_name = "newb";
    nick = "newb";
    timestamp_format = "%H:%M:%S";
  };
  "fe-text" = { scrollback_time = "24h"; };
  "fe-common/core" = { autolog = "yes"; };
};
#THIS SECTION DEALS WITH YOUR HILIGHTS
hilights = (
  { text = "newb"; nick = "yes"; word = "no"; },
);
settings = {
        core = {
                settings_autosave = "no";
        }
};
Now, you don't need to worry about most of this as it's just setting a lot of default things that won't need to be changed.
However there are a few sections you will/may want to change:
chatnets = {
  RedBrick =
  {
    type = "IRC";
        autosendcmd = "/msg chanserv identify <password>"; # put in your identify password here.
  };
};
channels = (
  { name = "#lobby"; chatnet = "RedBrick"; autojoin = "yes"; },
  { name = "#mychannel"; chatnet = "RedBrick"; autojoin = "yes"; },
);
What this part does is when you start irssi, it sends a priavte message to chanserv identifying you as you (if you've registered your nickname) and the bit underneath will automatically join you to the channels listed, namely #lobby and #mychannel. You can add as many channels as you want to this list, just copy and paste the same lines and edit the "#channel" bit. Simple really. This saves time and hassle if Redbrick ever restarts or you lose your connection for whatever reason as you don't have to remember all the channels you want to join.
#THIS SECTION DEALS WITH SETTINGS SUCH AS YOUR NAME AND TIMESTAMP FORMAT
settings = {
  core = {
    real_name = "Newb McNewberton";
    user_name = "newb";
    nick = "newb";
    timestamp_format = "%H:%M:%S";
  };
  "fe-text" = { scrollback_time = "24h"; };
  "fe-common/core" = { autolog = "yes"; };
};
#THIS SECTION DEALS WITH YOUR HILIGHTS
hilights = (
  { text = "newb"; nick = "yes"; word = "no"; },
);
Here you'll want to set your own name/nickname into the appropriate places. You may also want to change the timestamp_format = "%H:%H"; if you don't like having seconds displayed as well.
You may also want to delete the "autolog = "yes";" line too, if you do not want all you chat logged. Some users find this usual for checking back over past conversations. (It will save all chat in all the channels you're joined to, even if you haven't read it to ~/irclogs/RedBrick/)
The hilights section well, hilights specific words, commonly people will put their nickname in here, or other key words that they may be interested in.


== Configuration Options ==
== Configuration Options ==


Irssi comes with loads of options, so i've just included the ones I think are useful
Irssi comes with loads of options, so i've just included the ones I think are useful (These are to be used in chat)


  /set window_history off
  /set window_history off