User Tools

Site Tools


irssi

This is an old revision of the document!


IrSSi

Best Command line irc client.

Few simple things before you start using.

Common IRC commands

To register your nick on IRC
/msg nickserv register PASSWORD EMAIL
To verify your password
/msg nickserv identify PASSWORD
List Channel
/list
Join Channel
/join #<channel_name>
list all user
/who #<channel_name>
Give OP to all user
/op -YES *

Alias

This is something really powerfull please be carefull.
you can use shell command to execute and print on channel.

Fortune
/alias fortune exec - -o /usr/bin/fortune
Figlet
/alias figlet exec - -o /usr/bin/figlet -f times $0-

From other pages

remove activity from all windows:

alias UNACT script exec foreach $$w (Irssi::windows()) { Irssi::command(“window goto $$w->{refnum})\;} ; window goto $winref

calc with (10) decimals:

alias CALC execif which bc &>/dev/null\; then echoscale=10\;$*| bc | awk{print “$*=”$$1}’\; else echo bc was not found\; fi

Dump perl object (e.g. /dump Irssi::active_win):

alias DUMP script exec use Data::Dumper\; print Data::Dumper->new([\\$0-])->Dump

Put output of a command in the current window (e.g. /here help blah) (does not work with whois, and other output coming from the server):

alias HERE script exec \$a=Irssi::active_win\;sub b{Irssi::signal_remove(‘print text’,'b’)\;Irssi::signal_stop()\;\$a->print(\$_[1],\$_[0]->{‘level’})\;Irssi::signal_add_first(‘print text’,'b’)\;}\;Irssi::signal_add_first(‘print text’,'b’)\;\$a->command(“$*”)\;

do /lastlog, but for all windows… /alllast -HILIGHT would show all hilights in every buffer in the current window (like hilightwindow.pl, but not ‘life’)

alias ALLLASTLOG script exec foreach (Irssi::windows()) {Irssi::command(“lastlog – -window \$_->{‘refnum’} $*)\;}

execute a command on a given server (e.g. “/tag ircnet join #irssi” would join irssi on ircnet (if you’re connected to ircnet)):

alias TAG script exec Irssi::server_find_tag($0)->command($1-’);

list (say) your currently loaded scripts (just the names, on one line):

alias LISTSCRIPTS script exec foreach \$s (sort grep(s/::\$//, keys %Irssi::Script::)) {\$a .= “\$s “\;}\; Irssi::active_win->command(“say \$a)\;

list (print) a list of servers you’re currently connected to, what nick you have there, and on which channels you are:

alias LISTCHANS script exec foreach (Irssi::servers()){\$a=”\$_->{‘chatnet’}(\$_->{‘address’}) \$_->{‘nick’}:”\; foreach (\$_->channels()) {\$a.=’ ‘.(\$_->{‘ownnick’}->{‘op’}?’@':\$_->{‘ownnick’}->{‘voice’}?’+':”).”\$_->{‘name’}”\;}\;print \$a\;}

mass-op all non-voiced (to op everyone just use /op *):

alias MOP script exec foreach \$n (Irssi::active_win->{‘active’}->nicks()) {if (\$n->{‘op’} == 0 && \$n->{‘voice’} == 0) {\$a .= “\$n->{‘nick’} “\;}}\; Irssi::active_win->command(“OP \$a)\;

Show for how long you have been connected to the current server:

alias CONNECTIONUPTIME script exec \$a=`date +%s` – Irssi::active_win->{‘active_server’}->{‘connect_time’}\; Irssi::print( int(\$a/3600/24).”d “.int(\$a/3600%24).”h “. int(\$a/60%60).”m “. int(\$a%60).”s”)\;

Goto to x’th last window (0 = last, 1 = second last)

alias window_goto_last_minus script exec Irssi::command(“window goto “.(sort{\$b<=>\$a}map{\$_->{refnum}}Irssi::windows())[$0])

Remove all bans set by you

alias mubmy script exec \$c=Irssi::active_win->{‘active’}\;if(\$c){foreach \$ban (\$c->bans()){if(\$ban->{‘setby’} =~ /^$N/){\$unban.=\$ban->{‘ban’}.’ ‘\;}}}\;\$c->command(“unban \$unban);

source

IrSSi Settings

Environment File
~/.irssi/config
Save environment
/save
How to change theme on irssi
/set theme easyeye
Set DCC download folder
/set dcc_download_path /home/username
Set file permission after download
/set dcc_file_create_mode 660

NOTE : For security do not set mod with (x)

Nice Scripts

window_switcher

Download
Source

  * Add the statusbar item:
      /STATUSBAR window add window_switcher
  * Type /ws followed by a window number or part of a window or channel name.
  * When the right item is at the first place in the statusbar, press enter.
  * For faster usage, do “/BIND ^G multi erase_line;insert_text /ws “, type ctrl-G, and start typing…

ShortCut's

Ctrl-X to switch between network connections
Alt-[0-9] switch to windows

Binding F Key

/bind meta2-P     key F1
/bind meta2-Q     key F2
/bind meta2-R     key F3
/bind meta2-S     key F4
/bind meta2-15~   key F5
/bind meta2-17~   key F6
/bind meta2-18~   key F7
/bind meta2-19~   key F8
/bind meta2-20~   key F9
/bind meta2-21~   key F10
/bind meta2-24~   key F12
/bind meta2-23~   key F11
/bind meta2-24~   key F12
 
/bind meta2-2P    key sF1
/bind meta2-2Q    key sF2
/bind meta2-2R    key sF3
/bind meta2-2S    key sF4
/bind meta2-15;2~ key sF5
/bind meta2-17;2~ key sF6
/bind meta2-18;2~ key sF7
/bind meta2-19;2~ key sF8
/bind meta2-20;2~ key sF9
/bind meta2-21;2~ key sF10
/bind meta2-24;2~ key sF12
/bind meta2-23;2~ key sF11
/bind meta2-24;2~ key sF12

When you’ve done that, you can do, for example /bind F1 change_window 1 to bind something to F1, or /bind sF1 for shift-F1.

Source

My Environment

| ~/.irssi/config
servers = (
  { address = "irc.stealth.net"; chatnet = "IRCnet"; port = "6668"; },
  { address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; },
  { 
    address = "irc.undernet.org";
    chatnet = "Undernet";
    port = "6667";
  },
  { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
  { 
    address = "irc.quakenet.org";
    chatnet = "QuakeNet";
    port = "6667";
    use_ssl = "no";
    ssl_verify = "no";
    autoconnect = "yes";
  }
);
 
chatnets = {
  IRCnet = {
    type = "IRC";
    max_kicks = "4";
    max_msgs = "5";
    max_whois = "4";
    max_query_chans = "5";
  };
  EFNet = { 
    type = "IRC";
    max_kicks = "4";
    max_msgs = "3";
    max_whois = "1";
  };
  Undernet = {
    type = "IRC";
    max_kicks = "1";
    max_msgs = "3";
    max_whois = "30";
  };
  DALnet = {
    type = "IRC";
    max_kicks = "4";
    max_msgs = "3";
    max_whois = "30";
  };
  QuakeNet = {
    type = "IRC";
    max_kicks = "1";
    max_msgs = "3";
    max_whois = "30";
  }
};
 
channels = (
  { name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; },
  { name = "silc"; chatnet = "silc"; autojoin = "No"; },
  { name = "#linux"; chatnet = "QuakeNet"; 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";
  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";
  Q = "QUERY";
  "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save";
  EXEMPTLIST = "mode $C +e";
  ATAG = "WINDOW SERVER";
};
 
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}";
 
    topicbarstart = "{topicsbstart}";
    topicbarend = "{topicsbend}";
 
    # treated "normally", you could change the time/user name to whatever
    time = "{sb $Z}";
    user = "{sb {sbnickmode $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:$tag/$itemname{sbmode $M}}";
    window_empty = "{sb $winref{sbservertag $tag}}";
    prompt = "{prompt $[.15]itemname}";
    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 = {
        topicbarstart = { priority = "100"; };
        topic = { };
        topic_empty = { };
        topicbarend = { priority = "100"; alignment = "right"; };
      };
    };
  };
};
settings = {
  core = {
    real_name = "Ketan";
    user_name = "ketan";
    nick = "ketan";
    awaylog_level = "MSGS HILIGHT";
    awaylog_file = "~/irc/away.log";
  };
  "fe-text" = { actlist_sort = "refnum"; };
  "fe-common/core" = {
    theme = "thirdeye";
    autolog = "yes";
    autolog_path = "~/irc/%Y/$tag/$0.%m-%d.log";
    autolog_level = "ALL -CRAP -CLIENTCRAP -CTCPS";
    completion_auto = "yes";
    BEEP_WHEN_AWAY = "yes";
    window_auto_change = "yes";
  };
};
hilights = ( { text = "nick"; nick = "yes"; word = "yes"; } );
logs = { };
| ~/.irssi/thirdeye.theme
####                                 ####
####  ThirdEye 1.4                   ####
####  by salo <salo at Xtrmntr.org>  ####
####                                 ####
 
 
replaces = { "[]=" = "%K$0-%n"; };
abstracts = {
  line_start = "--- ";
  timestamp = "[$0-]";
  hilight = "%_$0-%_";
  error = "%G$0-%n";
  channel = "%c$0-%n";
  nick = "%_$0-%_";
  nickhost = "[$0-]";
  server = "%_$0-%_";
  comment = "[%_$0-%_]";
  reason = "{comment $0-}";
  mode = "{comment $0-}";
  channick_hilight = "%_$0-%_";
  chanhost_hilight = "{nickhost %c$0-%n}";
  channick = "%_$0-%_";
  chanhost = "{nick}";
  channelhilight = "%c$0-%n";
  ban = "%c$0-%n";
  msgnick = "<$1-> %|";
  ownnick = "%N$0-%n";
  pubnick = "%N$0-%n";
  menick = "%G$0-%n";
  pubmsgnick = "%c{msgnick $0 $1-%c}%N";
  pubmsgmenick = "%c{msgnick $0 $1-%c}%N";
  pubmsghinick = "%c{msgnick $1 %G$2-%n%c}%N";
  ownmsgnick = "%G{msgnick $0 %N$1-%G}%N";
  msgchannel = "%K:%c$0-%n";
  privmsg = "[%C$0%K(%c$1-%K)%n] ";
  ownprivmsg = "[%c$0%C(%n$1-%C)%n] ";
  ownprivnick = "$0-";
  ownprivmsgnick = "%C<%n$0%C>%n ";
  privmsgnick = "%c<%n$0%c>%n ";
  #  ownprivmsgnick = "%G{msgnick  %N$0-%G}%n";
  #  privmsgnick = "%c{msgnick  %G$0-%c}%N";
  action_core = "%G>>> %g$0-";
  action = "{action_core $0-} ";
  ownaction = "{action $0-}";
  ownaction_target = "{action_core $0}%K:%c$1%n ";
  pvtaction = "%W (*) $0-%n ";
  pvtaction_query = "{action $0-}";
  pubaction = "{action $0-}";
  ownnotice = "[%r$0%K(%R$1-%K)]%n ";
  notice = "%K-%M$0-%K-%n ";
  pubnotice_channel = "%K:%m$0-";
  pvtnotice_host = "%K(%m$0-%K)";
  servernotice = "%g!$0-%n ";
  ownctcp = "[%r$0%K(%R$1-%K)] ";
  ctcp = "%g$0-%n";
  wallop = "%W$0-%n: ";
  wallop_nick = "%n$0-";
  wallop_action = "%W * $0-%n ";
  netsplit = "%R$0-%n";
  netjoin = "%G$0-%n";
  names_nick = "[%G$0%g$1-%n] ";
  names_users = "$0-";
  names_channel = "on %G$0-%n:";
  dcc = "%y$0-%n";
  dccfile = "%_$0-%_";
  dccownmsg = "[%b$0%B(%n$1-%B)] ";
  dccownnick = "%W$0-%n";
  dccownaction = "{action $0-}";
  dccownaction_target = "{action_core $0}%K:%c$1%n ";
  dccmsg = "[%Y(%y$1-%Y)%n] ";
  dccaction = "%W (*dcc*) $0-%n %|";
  sb_background = "%4";
  sb = "%W[%n$0-%W]%n";
  sbmode = "(%c+%n$0-)";
  sbaway = " (%GzZzZ%n)";
  sbservertag = ":$0";
  sbmore = "%_-- more --%_";
  sblag = "{sb Lag: $0-}";
  sbmail = "{sb Mail: $0-}";
  sbact_act = "Act: $0-";
  sbact_det = "Det: $0-";
  sbact = "{sb {sbact_act $0}{sbact_det $1}}";
};
formats = {
  "fe-common/irc" = {
    whois = "%W$0 %K[%c$1@$2%K]%: ircname  :%W $3%n";
    whois_channels = " channels :%c $1%n";
    whois_server = " server   :%c $1 %K[%W$2%K]%n";
    whois_oper = " operator :%W $1 is IRC Operator%n";
    whois_away = " away     :%W $1%n";
    whois_idle = " idle     :%W $1 days, $2 hours, $3 mins, $4 secs%n";
  };
  "fe-common/silc" = {
    whois = "%W$0 %K[%c$1@$2%K]%: nickname    :%W $3 ($4)%n";
    whois_realname = " realname    :%W $0%n";
    whois_channels = " channels    :%c $0%n";
    whois_modes = " modes       :%c $0%n";
    whois_idle = " idle        :%W $0%n%";
    whois_fingerprint = " fingerprint :%c $0%n%:End of WHOIS";
  };
};
irssi.1316704045.txt.gz · Last modified: 2020/08/10 02:30 (external edit)