This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
irssi [2011/04/09 18:11] k2patel |
irssi [2020/08/10 02:35] (current) |
||
---|---|---|---|
Line 35: | Line 35: | ||
you can use shell command to execute and print on channel. | you can use shell command to execute and print on channel. | ||
- | ===== Fortune ===== | + | == Fortune == |
<code bash> | <code bash> | ||
/alias fortune exec - -o /usr/bin/fortune | /alias fortune exec - -o /usr/bin/fortune | ||
</code> | </code> | ||
+ | |||
+ | == Figlet == | ||
+ | <code bash> | ||
+ | /alias figlet exec - -o /usr/bin/figlet -f times $0- | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === From other pages === | ||
+ | |||
+ | |||
+ | remove activity from all windows: | ||
+ | <code bash> | ||
+ | alias UNACT script exec foreach $$w (Irssi::windows()) { Irssi::command(“window goto $$w->{refnum}”)\;} ; window goto $winref | ||
+ | </code> | ||
+ | |||
+ | calc with (10) decimals: | ||
+ | <code bash> | ||
+ | alias CALC exec – if which bc &>/dev/null\; then echo ‘scale=10\;$*’ | bc | awk ‘{print “$*=”$$1}’\; else echo bc was not found\; fi | ||
+ | </code> | ||
+ | |||
+ | Dump perl object (e.g. /dump Irssi::active_win): | ||
+ | <code bash> | ||
+ | alias DUMP script exec use Data::Dumper\; print Data::Dumper->new([\\$0-])->Dump | ||
+ | </code> | ||
+ | |||
+ | 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): | ||
+ | <code bash> | ||
+ | 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(“$*”)\; | ||
+ | </code> | ||
+ | |||
+ | 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’) | ||
+ | <code bash> | ||
+ | alias ALLLASTLOG script exec foreach (Irssi::windows()) {Irssi::command(“lastlog – -window \$_->{‘refnum’} $*”)\;} | ||
+ | </code> | ||
+ | |||
+ | execute a command on a given server (e.g. “/tag ircnet join #irssi” would join irssi on ircnet (if you’re connected to ircnet)): | ||
+ | <code bash> | ||
+ | alias TAG script exec Irssi::server_find_tag(‘$0′)->command(‘$1-’); | ||
+ | </code> | ||
+ | |||
+ | list (say) your currently loaded scripts (just the names, on one line): | ||
+ | <code bash> | ||
+ | alias LISTSCRIPTS script exec foreach \$s (sort grep(s/::\$//, keys %Irssi::Script::)) {\$a .= “\$s “\;}\; Irssi::active_win->command(“say \$a”)\; | ||
+ | </code> | ||
+ | |||
+ | list (print) a list of servers you’re currently connected to, what nick you have there, and on which channels you are: | ||
+ | <code bash> | ||
+ | alias LISTCHANS script exec foreach (Irssi::servers()){\$a=”\$_->{‘chatnet’}(\$_->{‘address’}) \$_->{‘nick’}:”\; foreach (\$_->channels()) {\$a.=’ ‘.(\$_->{‘ownnick’}->{‘op’}?’@':\$_->{‘ownnick’}->{‘voice’}?’+':”).”\$_->{‘name’}”\;}\;print \$a\;} | ||
+ | </code> | ||
+ | |||
+ | mass-op all non-voiced (to op everyone just use /op *): | ||
+ | <code bash> | ||
+ | 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”)\; | ||
+ | </code> | ||
+ | |||
+ | Show for how long you have been connected to the current server: | ||
+ | <code bash> | ||
+ | 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”)\; | ||
+ | </code> | ||
+ | |||
+ | Goto to x’th last window (0 = last, 1 = second last) | ||
+ | <code bash> | ||
+ | alias window_goto_last_minus script exec Irssi::command(“window goto “.(sort{\$b<=>\$a}map{\$_->{refnum}}Irssi::windows())[$0]) | ||
+ | </code> | ||
+ | |||
+ | Remove all bans set by you | ||
+ | <code bash> | ||
+ | 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”); | ||
+ | </code> | ||
+ | |||
+ | [[http://wouter.coekaerts.be/irssi/aliases | source]] | ||
==== IrSSi Settings ==== | ==== IrSSi Settings ==== | ||
Line 68: | Line 139: | ||
+ | ==== Nice Scripts ==== | ||
+ | |||
+ | |||
+ | === window_switcher === | ||
+ | |||
+ | [[ http://wouter.coekaerts.be/irssi/scripts/window_switcher.pl | Download ]] \\ | ||
+ | [[http://wouter.coekaerts.be/irssi/window_switcher | Source ]] | ||
+ | |||
+ | <code text> | ||
+ | * 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… | ||
+ | </code> | ||
+ | |||
+ | ==== ShortCut's ==== | ||
+ | |||
+ | <code bash> | ||
+ | Ctrl-X to switch between network connections | ||
+ | Alt-[0-9] switch to windows | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ==== Binding F Key ==== | ||
+ | |||
+ | <code bash> | ||
+ | /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 | ||
+ | </code> | ||
+ | |||
+ | 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. | ||
+ | [[http://wouter.coekaerts.be/irssi/keybindings | Source]] | ||
==== My Environment ==== | ==== My Environment ==== |