Skip to content
lacygoill edited this page Aug 28, 2023 · 23 revisions

Set yourself away and detach

/alias add /detach /away -all away; /exec -bg tmux detach

Fast-forward your buffer

/alias add /ff /repeat -interval 500 $1 /window scroll +1

/on, /off, /toggle an option (boolean)

With WeeChat < 3.4:

/alias add /on /set $1 on
/alias add /off /set $1 off
/alias add /toggle /set $1 toggle

With WeeChat ≥ 3.4: use /toggle command.

Append to a setting

/alias add append /eval /set $1 ${$1}$2-

Add current channel to autojoin

With WeeChat < 3.5:

/alias add addautojoin  /eval /set irc.server.$server.autojoin ${irc.server.$server.autojoin},$channel

With WeeChat ≥ 3.5: use /autojoin command.

Manually JOIN channels listed in server.autojoin

/alias add MJOIN /eval /join ${irc.server.${server}.autojoin}

Test a pending script

/alias add /runpendingscript /exec -norc wget -P /tmp/ 'http://weechat.org/files/scripts/pending/$1' ; /wait 1 /script load /tmp/$1

Show weather forecast (localisation in example is german):

/alias add weather /exec -noflush curl -s http://wttr\.in/$1?lang=de

Calculator (output to local buffer):

/alias add calc /exec -norc awk -vstring="$* = " "BEGIN{ print string, $* }"

Calculator 2 (output to channel):

/alias add calc /exec -sh -o echo '$*' | bc

Shorten url (output to channel):

/alias add shorten /exec -o -norc curl -s http://tinyurl.com/api-create.php?url=$1

Filter a nick

/alias add filternick /filter add $1 * nick_$1,irc_nick2_$1 *

Filter a nick for 2 hours

/alias add nf /mute filter add $1 * nick_$1,irc_nick2_$1  * ; /mute /filter add $1_2 * * $1 ;/wait 2h /mute filter del $1 ;/wait 2h /mute filter del $1_2

Set/Del a localvar from buffer

/alias add /LOCALVAR_SET /buffer set localvar_set_$1 $2
/alias add /LOCALVAR_DEL /buffer set localvar_del_$1

Collapse/uncollapse current server's buffers in buflist

/alias add collapse /allchan -current /buffer hide; /allpv -current /buffer hide
/alias add uncollapse /allchan -current /buffer unhide; /allpv -current /buffer unhide

Close window

Focuses other window instead of the current line like /window merge.

/alias add window_close /window swap; /window merge

Mark current buffer as unread and highlighted

/alias add unread /eval /eval -s /buffer weechat\;/command -buffer ${window.buffer.full_name} * /buffer set hotlist 3

View the log of current buffer in tmux

/alias add log /eval /exec -bg tmux new-window sh -c "less +G $(echo ~/.weechat/logs/${buffer.full_name}.weechatlog | tr '[:upper:]' '[:lower:]')"

Close all buffers named *status (ZNC)

/alias add statusclose /allpv -include=*status /buffer close