Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

The squares in the chanmon buffer at the top of weechat in the gif above are there only to hide the nicknames and the messages in the gif to respect users privacies

You need at least WeeChat 3.4-dev

Enable mouse

/mouse enable

Secured data

/secure passphrase <pass>
/secure set bitlbeepass <pass>
/secure set liberachatpass <pass>
/secure set relaypass <pass>
/secure set defaultnicks <nicks-csv>
/secure set defaultsasluser <username>

Network

Default settings

/set irc.server_default.sasl_mechanism PLAIN
/set irc.server_default.sasl_username ${sec.data.defaultsasluser}
/set irc.server_default.nicks ${sec.data.defaultnicks}
/set irc.server_default.capabilities "*"

Network-specific settings

/server add bitlbee localhost -autoconnect
/set irc.server.bitlbee.sasl_password ${sec.data.bitlbeepass}

/server add libera irc.libera.chat/6697 -ssl -autoconnect
/set irc.server.libera.sasl_password ${sec.data.liberachatpass}

/server add oftc irc.oftc.net/6697 -ssl -autoconnect
/set irc.server.oftc.ssl_cert "%h/ssl/nick.pem"
/set irc.server.oftc.command_delay 5

/server add ergo_testnet testnet.ergo.chat/6697 -ssl

/connect -auto

Plugins

Load at startup

/set weechat.plugin.autoload "*,!guile,!javascript,!lua,!php,!tcl,!perl,!ruby,!fifo,!xfer"

this will load all modules except guile, javascript, lua, php, tcl, perl, ruby, fifo and xfer

spell

/set spell.check.default_dict en,fr
/set spell.check.suggestions 3
/set spell.color.suggestion *green
/spell enable

Relay

/relay sslcertkey
/relay add ssl.irc <port>
/relay add ssl.weechat <port>
/set relay.network.password ${sec.data.relaypass}

If you want a trusted certificate, use let's encrypt! with weechat relay.

Logger

/set logger.level.irc 4
/set logger.mask.irc %Y/$server/$channel.%m-%d.log

fset

≥ WeeChat 3.0 for fset.look.auto_refresh

/set fset.color.line_selected_bg1 default
/set fset.color.name_changed 229
/set fset.color.name_changed_selected *229
/set fset.color.type 121
/set fset.color.type_selected *121
/set fset.color.value 31
/set fset.color.value_changed 229
/set fset.color.value_changed_selected *229
/set fset.color.value_selected *31
/set fset.look.auto_refresh "*,!weechat.bar.buflist.size,!plugins.var.buflist.section.*,!plugins.var.python.text_item.conky_*"
/set fset.format.option1 "${if:${selected_line}?${color:*white}>>:  } ${marked} ${name}  ${type}  ${value2}"
/set weechat.bar.fset.conditions "${buffer.full_name} == fset.fset && ${window.win_height} > 7"

Scripts

/set script.scripts.download_enabled on
/script install autojoin.py buffer_autoset.py autosort.py

autosort.py

/autosort helpers set monitors_buffers_first ${if:${buffer.full_name}!~^core\.(chan|high|news)mon$}
/autosort rules insert 3 ${monitors_buffers_first}

monitors buffers (chanmon, highmon and newsmon) will appears before other core buffers (except core.weechat)

buffer_autoset.py

/buffer_autoset add core.weechat notify 3
/buffer_autoset add irc.server.* notify 3
/buffer_autoset add relay.relay.list short_name relay

Conky

≥ WeeChat 3.1 for ${raw:...}

/exec -nosw -norc -noln -sh -buffer conky conky -C > ~/.conkyrc && conky -t 'Uptime: $uptime_short\nCPU: $cpu%\nRAM: $memperc%\nSwap: $swapperc%\nUp: ${upspeedf eth0} KiB\nDown: ${downspeedf eth0} KiB'
/eval /set weechat.startup.command_after_plugins ${weechat.startup.command_after_plugins}${if:${weechat.startup.command_after_plugins}!=?;}/exec -nosw -norc -noln -buffer conky conky -t 'Uptime: $uptime_short\nCPU: $cpu%\nRAM: $memperc%\nSwap: $swapperc%\nUp: ${raw:${raw:${upspeedf eth0}}} KiB\nDown: ${raw:${raw:${downspeedf eth0}}} KiB'
/buffer_autoset add exec.exec.conky short_name sys
/set weechat.notify.exec.exec.conky none
/buffer_autoset add exec.exec.conky title Conky - the light-weight system monitor

beautify the output

/trigger addreplace conky modifier weechat_print
/trigger set conky conditions "${tg_buffer} == exec.exec.conky && ${tg_tags} =~ ,exec_stdout, && ${tg_message_nocolor} =~ ^[^:]+: *[^ ]"
/trigger set conky regex "/^ \t([^:]+):(.*)/ ${color:_31}${re:1}\t${color:reset}${re:2}/ /.*/${tg_message_nocolor}/my_field /.*/${tg_message_nocolor}/my_value /^([^:]+):.*/${re:1}/my_field / /_/my_field /[^:]+: *(.*)/${re:1}/my_value"
#/trigger set conky command "/mute /set plugins.var.python.text_item.conky_${my_field} all ${my_field} ${color:white}${my_value}"

This trigger does two things. First (the regex line), it change the look of the ouput to be easier to read and to match the look of the rest of the config. Second (the command line), it create a text_item option for all line and if the conky buffer is not displayed on screen, the items created by text_item will become visibile in the status bar (go to the status bar section to add it to the bar). If you have weechat < 3.0 you should not use the last line because if you open fset at the same time your cpu will reach 100% (see this. If you have weechat ≥ 3.0 it is safe but you must set the option fset.look.auto_refresh value as mine (see the fset section)

Note: you need the conky-cli package on Debian

Bars

Bar buflist and control_buffers

≥ WeeChat 3.4 for ${define:...}

WeeChat Screenshot

the buflist should now be a lot faster thanks to ${define:...} but remains slow nonetheless since the whole buflist is refresh on each hotlist_changed signals (which is why all buflists are slow no matter how they are configured, but mine is worse than most since the format options are complex and that I am using all three buflist items instead of just one.)

Here are some tips if you want to make the buflist faster

  1. If you don't use the tab bars (called the control_buffers bars), set buflist.look.use_items to 1
  2. If you don't mind low messages (join/part/quit...) set the default notify level to something higher
  3. By collapsing servers buffers

/bar set buflist priority 2000

unmerge servers buffers from core and indent

/set irc.look.server_buffer independent

Note: show channels and privates buffers under their respective server instead of mixing them all.

/trigger addreplace buflist_tools command "buflist_tools;manage pascalpoitras's custom buflist (https://gist.github.com/pascalpoitras/8406501);resize <buflist_size> <left_size>|? [<right_size>] || hide|show|itoggle|showonly|hideonly <item>|-all [<item>|-all...] || enable|disable|toggle <feature> [<feature>...];       resize: resize the buflist size and the two sections${\n}         hide: hide one or more item(s)${\n}         show: show one or more item(s)${\n}      itoggle: toggle one or more item(s)${\n}     showonly: hide all items except...${\n}     hideonly: show all items except...${\n}       enable: enable a feature that change the behavior of the buflist${\n}      disable: disable a feature that change the behavior of the buflist${\n}       toggle: toggle a feature that change the behavior of the buflist${\n} buflist_size: new size for the buflist${\n}    left_size: size of left section${\n}   right_size: size of right section${\n}         item: an item (buffer_number, fold, indent, nick_prefix, buffer_name, lag, filter, relay_count, extra, hotlist)${\n}         -all: do action on all items${\n}      feature: a feature (indent_tree, real_net_name, show_hidden_buffers)${\n}${\n}The buflist is composed of two sections. The left section is composed of nine items. The buffer number, the fold symbol (servers only), the indentation, the nick prefix (channels only), the buffer name, the lag (servers only), the filter (on some buffer like fset, scripts...), the relay count (for the relay buffer) and extra infos about a buffer. The right section is only composed of hotlist. The two sections can be resized independently.${\n}${\n}Exemples:${\n}  Resize the bar to 20 with the size 15 for left section and 5 for right section:${\n}    /buflist_tools resize 20 15;resize 20 15 || show|hide|itoggle|hideonly|showonly buffer_number|fold|indent|nick_prefix|buffer_name|lag|filter|relay_count|extra|hotlist|-all|%* || enable|disable|toggle indent_tree|real_net_name|show_hidden_buffers|%*"
/trigger set buflist_tools conditions "${tg_argv_eol1} =~ ^resize +[0-9]+ +([0-9]+( +[0-9]+)?|\? +[0-9]+)$ || ${tg_argv_eol1} =~ ^(hide|show|itoggle|showonly|hideonly) +(([[:alnum:]_]+|-all)( +|$))+$ || ${tg_argv_eol1} =~ ^(enable|disable|toggle) +([[:alnum:]_]+( +|$))+$"
/trigger set buflist_tools regex "/.*/${tg_argv1}/my_action /.*/${if:${my_action}==resize?${tg_argv_eol2}}/my_resize_cmds ===^([^ ]+) +([^ ]+)( +([^ ]+))?$===${define:my_buflist_size,${re:1}}${define:my_left_size,${re:2}}${define:my_right_size,${re:4}}/mute /set plugins.var.buflist.section.left.size ${if:${my_left_size}=~[0-9]+?${my_left_size}:${calc:${my_buflist_size}-${my_right_size}}};/mute /set plugins.var.buflist.section.right.size ${if:${my_right_size}=~[0-9]+?${my_right_size}:${calc:${my_buflist_size}-${my_left_size}}};/bar set buflist size ${my_buflist_size}===my_resize_cmds /.*/${if:${my_action}=~^(hide|show|itoggle|showonly|hideonly)$?${tg_argv_eol2}}/my_item_cmds /.*/buffer_number fold indent nick_prefix buffer_name lag filter relay_count extra hotlist/my_items /-all/${my_items}/my_item_cmds /.*/${if:${my_action}=~^(hide|show)only$?${my_items}}/my_hide_or_show_everything ===[^ ]+===/mute /set plugins.var.buflist.item.${re:0} ${if:${my_action}==hideonly};===my_hide_or_show_everything ===[^ ]+===/mute /set plugins.var.buflist.item.${re:0} ${if:${my_action}=~^hide?0:${if:${my_action}=~^show?1:\x5c${if:\x5c${plugins.var.buflist.item.${re:0}${\x5cx7d}?0:1${\x5cx7d}}};===my_item_cmds /.*/${my_hide_or_show_everything}${re:0}/my_item_cmds /.*/${if:${my_action}=~^(enable|disable|toggle)$?${tg_argv_eol2}}/my_look_cmds ===[^ ]+===/mute /set plugins.var.buflist.look.${re:0} ${if:${my_action}==disable?0:${if:${my_action}==enable?1:${if:${plugins.var.buflist.look.${re:0}}!=?0:1}}};===my_look_cmds /.*/${my_resize_cmds}${my_item_cmds}${my_look_cmds}/my_cmds_to_run"
/trigger set buflist_tools command "/command -buffer core.weechat * /eval -s ${my_cmds_to_run}"

This trigger create the command buflist_tools. With this command you can resize the buflist and the sections and show or hide items. Type /help buflist_tools for more.

/buflist_tools resize 20 15

The buflist will be resized to 20. 15 columns for the left section and 5 columns for the right section

/buflist_tools hideonly extra nick_prefix lag
/buflist_tools enable indent_tree real_net_name

I want to show all the items except extra, nick_prefix and lag. I want to display real network name (not the one used in /server add). Instead of spaces for the indent item, I want tree symbols.

/bar add control_buffers window top 1 1 buflist2
/bar set control_buffers priority 499
/bar set control_buffers conditions ${window.number} == ${if:${plugins.var.control_buffers_window}?${plugins.var.control_buffers_window}:2}

/bar add control_buffers2 window top 1 1 buflist3
/bar set control_buffers2 priority 499
/bar set control_buffers2 conditions ${window.number} == ${if:${plugins.var.control_buffers2_window}?${plugins.var.control_buffers2_window}:3} && ${layout[gui_layout_current].name} == main-control-control2

Create the control_buffers bar with buflist2 for items and display this bar only on the window with the same number as the number in the option plugins.var.control_buffers_window (or 2 if this options doesn't exist). Same for control_buffers2 bar

/set buflist.format.hotlist_highlight "${color:163}"
/set buflist.format.hotlist_message "${color:229}"
/set buflist.format.hotlist_private "${color:121}"

/set buflist.format.buffer "${if:${bar_item.name}==buflist?${define:my_left_section_contents,${format_number}${eval:${plugins.var.buflist.format.fold}}${indent}${format_nick_prefix}${format_name}${format_lag}${eval:${plugins.var.buflist.format.filter}${plugins.var.buflist.format.relay_count}${plugins.var.buflist.format.extra}}}${define:my_left_section_contents_length,${lengthscr:${my_left_section_contents}}}${define:my_right_section_contents,${format_hotlist}}${define:my_right_section_contents_length,${lengthscr:${my_right_section_contents}}}${if:${type}==server?${color:,31}:${color:default}}${if:${my_left_section_contents_length} > ${plugins.var.buflist.section.left.size}?${cutscr:+${plugins.var.buflist.section.left.size},${if:${type}==server?${color:white}:${color:${weechat.color.chat_prefix_more}}}${weechat.look.prefix_align_more},${my_left_section_contents}}:${my_left_section_contents}${repeat:${calc:${plugins.var.buflist.section.left.size} - ${my_left_section_contents_length}}, }}${if:${my_right_section_contents_length} > ${plugins.var.buflist.section.right.size}?${cutscr:+${plugins.var.buflist.section.right.size},${if:${type}==server?${color:white}:${color:${weechat.color.chat_prefix_more}}}${weechat.look.prefix_align_more},${my_right_section_contents}}:${repeat:${calc:${plugins.var.buflist.section.right.size} - ${my_right_section_contents_length}}, }${my_right_section_contents}}:${define:my_remaining_space,${calc:7-${lengthscr:${name}}}}${define:my_name,${cutscr:7,${\u2026},${name}${repeat:${my_remaining_space}, }}}${if:${window.buffer}==${buffer}?${color:31}${\ue0be}${color:white,31} ${my_name} ${color:reset}${color:31}${\ue0bc}:${color:24}${\ue0be}${color:darkgray,24} ${my_name} ${color:reset}${color:24}${\ue0bc}}}"
/set buflist.format.buffer_current "${format_buffer}"
/set buflist.format.number "${if:${plugins.var.buflist.item.buffer_number}!=?${if:${current_buffer}?${color:*white}${hide:>,${number}} :${if:${type}==server?${color:black}:${color:239}}${number}${if:${number_displayed}?.: }}}"
/set buflist.format.indent "${if:${plugins.var.buflist.item.indent}!=?${if:${plugins.var.buflist.look.indent_tree}!=?${color:31}├─:  }}"
/set buflist.format.name "${if:${plugins.var.buflist.item.buffer_name}!=?${define:my_name,${if:${type}==server?${if:${plugins.var.buflist.look.real_net_name}!=&&${info:irc_server_isupport_value,${name},NETWORK}!=?${info:irc_server_isupport_value,${name},NETWORK}:${name}}:${name}}}${define:my_name_length,${lengthscr:${my_name}}}${if:${type}==server?${color:white}:${eval:${color_hotlist}}}${if:${buffer.local_variables.start_at}!=?${revscr:${cutscr:+${calc:${my_name_length}-${buffer.local_variables.start_at}},…,${revscr:${my_name}}}}:${my_name}}}"
/set buflist.format.hotlist "${if:${plugins.var.buflist.item.hotlist}!=?${if:${plugins.var.buflist.section.right.size}==1? :${hotlist}}}"
/set buflist.format.nick_prefix "${if:${plugins.var.buflist.item.nick_prefix}!=&&${buflist.look.nick_prefix}!=?${color:31}${nick_prefix}}"
/set buflist.format.lag "${if:${plugins.var.buflist.item.lag}!=?${color:white} [${lag}]}"
/set plugins.var.buflist.format.fold "${if:${plugins.var.buflist.item.fold}!=&&${type}==server?${color:black}${if:${buffer.local_variables.fold}==?▼:▲} }"
/set plugins.var.buflist.format.filter "${if:${plugins.var.buflist.item.filter}!=&&${buffer.local_variables.filter}!=? ${if:${type}==server?${color:black}:${color:31}}${buffer.local_variables.filter}}"
/set plugins.var.buflist.format.relay_count "${if:${plugins.var.buflist.item.relay_count}!=&&${buffer.full_name}==relay.relay.list&&${info:relay_client_count,*,connected}!=? ${color:31}Total${\x3A}${info:relay_client_count,*,connected} IRC${\x3A}${info:relay_client_count,irc,connected} WeeChat${\x3A}${info:relay_client_count,weechat,connected}}"
/set plugins.var.buflist.format.extra "${if:${plugins.var.buflist.item.extra}!=&&${buffer.local_variables.extra}!=? ${if:${type}==server?${color:black}:${color:31}}${buffer.local_variables.extra}}"

This was the format options which changed the look of each buflist items

/set buflist.look.use_items 3

Use all three buflist items

/set buflist.look.signals_refresh "irc_server_connected,relay_client_connected,relay_client_disconnected"

Add additionnals signals to refresh the buflist

/set buflist.look.display_conditions "${bar_item.name} == buflist && (${buffer.hidden} == || ${plugins.var.buflist.look.show_hidden_buffers} !=) && (${type} !~ ^(channel|private)$ || ${type} =~ ^(channel|private)$ && ${buffer[${if:${plugin}==irc?${info:irc_buffer,${irc_server.name}}:${info:slack_matrix_server_search,${buffer}}}].local_variables.fold}==) || ${bar_item.name} == buflist2 && ${buffer.local_variables.control_buffer} != || ${bar_item.name} == buflist3 && ${buffer.local_variables.control_buffer2} !="

The conditions to display a buffer in the buflist items.

/trigger addreplace buflist_refresh_options config "weechat.bar.buflist.size*;plugins.var.buflist.*"
/trigger set buflist_refresh_options command "/buflist refresh"

when the buflist is resized, the buflist is refresh. Same for all the plugins.var.buflist.* options

/trigger addreplace control_buffers_change_control_window config "plugins.var.control_buffers_window;plugins.var.control_buffers2_window"
/trigger set control_buffers_change_control_window command "/window refresh"

Refresh window when options plugins.var.control_buffers_window and plugins.var.control_buffers2_window are changed

/trigger addreplace slack_matrix_server_search info slack_matrix_server_search
/trigger set slack_matrix_server_search conditions "${info:python_version} != && ${tg_arguments} != && (${buffer[${tg_arguments}].local_variables.script_name} =~ ^(slack|matrix)$ || ${buffer[${tg_arguments}].local_variables.plugin} == matrix)"
/trigger set slack_matrix_server_search regex "/.*/${buffer[${tg_arguments}].local_variables.plugin}/my_plugin /.*/${buffer[${tg_arguments}].local_variables.script_name}/my_script /.*/${if:${my_plugin}==matrix||${my_script}==matrix?server.}/my_server_prefix /.*/${buffer[${tg_arguments}].local_variables.server}/my_server /.*/${my_plugin}.${my_server_prefix}${my_server}/my_server_full_name ==\x5c\x5c==\x5c\x5c==my_server_full_name =='==\'==my_server_full_name /.*/${info:python_eval,print(weechat.buffer_search('==', '${my_server_full_name}'))}/tg_info"

This trigger is needed if you want to be able to expand/collapse slack and matrix servers not just irc

/key bindctxt mouse @item(buflist*)>bar(control_buffers*):button1* hsignal:toggle_property
/key bindctxt mouse @chat(*)>bar(control_buffers*):button1* hsignal:toggle_property
/key bindctxt mouse @bar(control_buffers*)>chat(*):button1* /mute /set plugins.var.${_bar_name}_window ${_window_number2}
/key bindctxt mouse @bar(buflist):alt-wheel* hsignal:buflist_resize
/key bindctxt mouse @bar(buflist):ctrl-alt-wheel* hsignal:buflist_buffer_scroll
/key bindctxt mouse @item(buflist2):button1* /mute /set plugins.var.control_buffers_previous_active_window ${window.number};/window ${_window_number};hsignal:buflist_mouse;/window ${plugins.var.control_buffers_previous_active_window}
/key bindctxt mouse @item(buflist3):button1* /mute /set plugins.var.control_buffers2_previous_active_window ${window.number};/window ${_window_number};hsignal:buflist_mouse;/window ${plugins.var.control_buffers2_previous_active_window}
/key bindctxt cursor @item(buflist*):c hsignal:toggle_property;/cursor stop
/key bindctxt cursor @item(buflist*):C hsignal:toggle_property;/cursor stop
/key bindctxt cursor @item(buflist*):f hsignal:toggle_property;/cursor stop
/key bindctxt cursor @item(buflist*):r /server raw c:\${${if:${localvar_type}==private?nick:${localvar_type}}}==${localvar_channel};/cursor stop
/key bindctxt cursor @item(buflist*):o /fset c:\${name}=*buffer_autoset.buffer.${full_name}.* ${if:${localvar_type}==server?|| \${name${\x7D}=*${full_name}.*};/cursor stop
/key bindctxt cursor @item(buflist*):n hsignal:toggle_property;/cursor stop
/key bindctxt cursor @item(buflist*):h hsignal:toggle_property;/cursor stop
/key bindctxt cursor @item(buflist):H /buflist_tools toggle show_hidden_buffers;/cursor stop

/trigger addreplace toggle_bufautoset command "toggle_bufautoset;toggle bufautoset options;<buffer_property> <buffer_fullname>;buffer_property: name of the property${\n}buffer_fullname: name of the buffer${\n}${\n}The buffer_autoset.py script has no toggle mechanism so this command bring this functionality. Also, the script does not reset a property or localvar after deleting them. For example, if you type /buffer_autoset add irc.libera.#weechat localvar_set_something 1, and then, /buffer_autoset del irc.libera.#weechat.localvar_set_something, the localvar will still appears in /buffer localvar until you close and reoppen the buffer. This command will remove the localvar and hidden property upon deletion. You should use this command only for properties that take 0 or 1 as value or localvar that take 0 or 1.;;"
/trigger set toggle_bufautoset conditions "${tg_argv2} !="
/trigger set toggle_bufautoset regex "/.*/${tg_argv1}/my_property /.*/${tg_argv2}/my_full_name /.*/${if:${buffer_autoset.buffer.${my_full_name}.${my_property}}!=?del:add}/my_action /.*/${if:${my_action}==add? ${my_full_name} ${my_property} 1: ${my_full_name}.${my_property}}/my_params"
/trigger set toggle_bufautoset command "/mute /buffer_autoset ${my_action} ${my_params};/command -buffer ${my_full_name} * /buffer set ${my_property} ${if:${my_action}==add?1:0}"

/trigger addreplace toggle_property hsignal toggle_property
/trigger set toggle_property regex "/.*/${if:${_chat}!=?${_buffer_full_name}:${full_name}}/my_full_name /.*/${if:${_chat}!=?${_buffer_plugin}:${plugin}}/my_plugin /.*/${if:${_chat}!=?${_buffer_localvar_server}:${localvar_server}}/my_server /.*/${buffer[${pointer}].local_variables.script_name}/my_script_name /.*/${if:${_key}==f?${my_plugin}.${if:${my_plugin}==irc||${my_script_name}==matrix||${my_plugin}==matrix?server.}${my_server}:${re:0}}/my_full_name /.*/${_key}/my_property /^button1.*/localvar_set_control_buffer${if:${_bar_name2}==control_buffers2?2}/my_property /(?-i)^c$/localvar_set_control_buffer/my_property /(?-i)^C$/localvar_set_control_buffer2/my_property /(?-i)^n$/localvar_set_no_chanmon_like/my_property /(?-i)^f$/localvar_set_fold/my_property /(?-i)^h$/hidden/my_property"
/trigger set toggle_property command "/toggle_bufautoset ${my_property} ${my_full_name}"

/trigger addreplace buflist_resize hsignal buflist_resize
/trigger set buflist_resize conditions "${_key}=~down || ${_key}=~up && (${_bar_item_col} < ${plugins.var.buflist.section.left.size} && ${plugins.var.buflist.section.left.size} > 1 || ${_bar_item_col} >= ${plugins.var.buflist.section.left.size} && ${plugins.var.buflist.section.right.size} > 1)"
/trigger set buflist_resize regex "/.*/${if:${_key}=~up$?-:+}/my_action /.*/${if:${_bar_item_col}<${plugins.var.buflist.section.left.size}?left:right}/my_modified_section /.*/${calc:${plugins.var.buflist.section.${my_modified_section}.size} ${my_action} 1}/my_modified_section_size /.*/${if:${weechat.bar.${_bar_name}.size}!=?${calc:${weechat.bar.${_bar_name}.size} ${my_action} 1}:0}/my_new_bar_size"
/trigger set buflist_resize command "/mute /set plugins.var.buflist.section.${my_modified_section}.size ${my_modified_section_size};/bar set ${_bar_name} size ${my_new_bar_size}"

/trigger addreplace buflist_buffer_scroll hsignal buflist_buffer_scroll
/trigger set buflist_buffer_scroll conditions "${_key} =~ -wheeldown$ || ${buffer[${pointer}].local_variables.start_at} !="
/trigger set buflist_buffer_scroll regex "/.*/${if:${buffer[${pointer}].local_variables.start_at}==?0:${buffer[${pointer}].local_variables.start_at}}/my_start_at /.*/${calc:${my_start_at}${if:${_key}=~up&&${my_start_at}!=?-:+}1}/my_start_at"
/trigger set buflist_buffer_scroll command "/mute /buffer_autoset add ${full_name} localvar_set_start_at ${my_start_at}"

/trigger addreplace buflist_fold_symbol_click hsignal 1001|buflist_mouse
/trigger set buflist_fold_symbol_click conditions "${localvar_type} == server && ${plugins.var.buflist.item.fold} != && (${plugins.var.buflist.item.buffer_number} != && ${_bar_item_col} == ${lengthscr:${buffer[last_gui_buffer].number}.} || ${plugins.var.buflist.item.buffer_number} == && ${_bar_item_col} == 0)"
/trigger set buflist_fold_symbol_click command "/toggle_bufautoset localvar_set_fold ${full_name}"
/trigger set buflist_fold_symbol_click return_code "ok_eat"
  1. This bind allow drag and drop from any buflist items to the bar control_buffers. This will add or del the buffer to the control_buffers bar.
  2. This bind allow drag and drop from a chat area to the control_buffers and control_buffers2 bar. This will add or del the buffer to the control_buffers or control_buffers2 bar.
  3. This bind allows drag and drop from the control_buffers and control_buffers2 bar to a chat area. This will move the control_buffers or control_buffers2 bar to another window.
  4. This bind allows you to resize the buflist bar by pressing alt and using the wheel at the same time.
  5. This bind allows you to scroll the buffer name by pression ctrl, alt and the wheel at the same time.
  6. This bind will switch to the control window and display the buffer you clicked on and then switch back to the previous window.
  7. This bind will switch to the control2 window and display the buffer you clicked on and then switch back to the previous window.
  8. This bind allow you to press 'c' in cursor mode on any buflist items to add or del the buffer to the control_buffers bar.
  9. This bind allow you to press 'C' in cursor mode on any buflist items to add or del the buffer to the control_buffers2 bar.
  10. This bind will hide the channels and private buffer of a network.
  11. This bind will show server raw messages for server/channel/private depending on the buffer.
  12. This bind will show options, in fset, related to the buffer.
  13. This bind allow you to press 'n' in cursor mode on any buflist items to add or remove buffer in chanmon
  14. This bind allow you to press 'h' in cursor mode on any buflist items to hide a buffer
  15. This bind allow you to press 'H' in cursor mode on the buflist items to toggle the option show_hidden_buffers (when this option is set, the hidden buffers are displayed in the buflist, this is useful to unhide them with 'h')

The last trigger need WeeChat 2.9 for this: only return trigger's return code when condition evaluates to true

/set plugins.var.control_buffers_window 2
/set plugins.var.control_buffers2_window 3

/buffer_autoset add core.weechat localvar_set_control_buffer 1
/buffer_autoset add core.chanmon localvar_set_control_buffer 1
/buffer_autoset add core.highmon localvar_set_control_buffer 1
/buffer_autoset add core.newsmon localvar_set_control_buffer 1

/buffer_autoset add core.weechat localvar_set_control_buffer2 1
/buffer_autoset add core.chanmon localvar_set_control_buffer2 1
/buffer_autoset add core.highmon localvar_set_control_buffer2 1
/buffer_autoset add core.newsmon localvar_set_control_buffer2 1

set window number 2 as the control window (the window with the control_buffers bar) and set window number 3 as the control2 window (the window with the control_buffers2 bar).

Bar titlenosep

/bar del title
/bar add titlenosep window top 1 0 [#window_number],buffer_title
/bar set titlenosep priority 500
/bar set titlenosep conditions ${window.number} == ${if:${plugins.var.control_buffers_window}!=?${plugins.var.control_buffers_window}:2} || ${window.number} == ${if:${plugins.var.control_buffers2_window}!=?${plugins.var.control_buffers2_window}:3} && ${layout[gui_layout_current].name} == main-control-control2
/bar set titlenosep color_fg white
/bar set titlenosep color_bg 31
/bar set titlenosep color_bg_inactive 31

A window bar to display the title, with no separator. Used on the window with the number corresponding to the option plugins.var.control_buffers_window and on the window with the number corresponding to the option plugins.var.control_buffers2_window

Bar titlesep

/bar add titlesep window top 1 1 [#window_number],buffer_title
/bar set titlesep priority 500
/bar set titlesep conditions ${window.number} != ${if:${plugins.var.control_buffers_window}!=?${plugins.var.control_buffers_window}:2} && (${window.number} != ${if:${plugins.var.control_buffers2_window}!=?${plugins.var.control_buffers2_window}:3} || ${window.number} == ${if:${plugins.var.control_buffers2_window}!=?${plugins.var.control_buffers2_window}:3} && ${layout[gui_layout_current].name} != main-control-control2)
/bar set titlesep color_fg white
/bar set titlesep color_bg 31
/bar set titlesep color_bg_inactive 31

A window bar to display the title with a separator. All window except those with a number corresponding to the options plugins.var.control_buffers_window and plugins.var.control_buffers2_window

Bar status

/bar del status
/bar add status root bottom 1 1 [time],[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+buffer_zoom+buffer_filter,scroll,[lag],[spell_dict],[spell_suggest],completion
/bar set status priority 500
/bar set status color_fg 31
/bar set status color_bg 234
#/eval /set weechat.bar.status.items ${weechat.bar.status.items},conky_CPU,conky_RAM,conky_Swap,conky_Up,conky_Down

Uncomment the last line if you want to show system info using conky when the conky buffer is not displayed. You will need the conky trigger and the script text_item.py

Bar input

/bar add rootinput root bottom 0 0 [input_prompt]+(away),[input_search],[input_paste],input_text
/bar set rootinput priority 1000
/bar del input
/bar set rootinput name input

Bar Nicklist

/bar set nicklist color_fg 229
/bar set nicklist separator 1
/bar set nicklist conditions ${nicklist} && ${window.number} == 1 && ${buffer.full_name} != ${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.##news} && ${buffer.full_name} != core.newsmon
/bar set nicklist size_max 14
/bar set nicklist size 14

Note: I changed the conditions to display the nicklist only on buffer of type channels ${nicklist} and on the window number 1, which is my chat window (2 being my highlight window and 3 my conky window). In my case, I could remove ${window.numer} == 1 because the highmon and exec buffer (conky) are not of type channels so ${nicklist} is enough.

Monitors

Channel Monitor

≥ WeeChat 3.4 for ${define:...}

WeeChat Screenshot

[trigger]  /chanmon_tools  enable|disable|toggle <feature> [<feature>...]
                           add <item>,[<item>...] ["<pos>" ["<min_len>" ["<max_len>" ["<fg>" ["<bg>" ["<sep>" ["<content>" ["<cond>"]]]]]]]]
                           set <item>,[<item>...] <option>,[<option>...] [<value>]
                           switch <item> <item>
                           list|iclear|pop|shift|lclear
                           del|push|remove|replace|unshift <item> [<item>...]

this is the command syntax

/buffer add chanmon
/eval /set weechat.startup.command_after_plugins ${weechat.startup.command_after_plugins}${if:${weechat.startup.command_after_plugins}!=?;}/buffer add chanmon
/buffer_autoset add core.chanmon notify none
/buffer_autoset add core.chanmon highlight_words -
/buffer_autoset add core.chanmon title Channels Monitor
/buffer_autoset add core.chanmon time_for_each_line 0
/buffer_autoset add core.chanmon localvar_set_no_chanmon_like 1
/eval /buffer_autoset add ${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.##news} localvar_set_no_chanmon_like 1

/trigger addreplace chanmon_tools command "chanmon_tools;manage the ${split:1,_,,${tg_trigger_name}} buffer;enable|disable|toggle <feature> [<feature>...] || add <item>,[<item>...] [${\x22}<pos>${\x22} [${\x22}<min_len>${\x22} [${\x22}<max_len>${\x22} [${\x22}<fg>${\x22} [${\x22}<bg>${\x22} [${\x22}<sep>${\x22} [${\x22}<content>${\x22} [${\x22}<cond>${\x22}]]]]]]]] || set <item>,[<item>...] <option>,[<option>...] [<value>] || switch <item> <item> || list|iclear|pop|shift|lclear || del|push|remove|replace|unshift <item> [<item>...]; enable: enable an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n} toggle: toggle an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n}disable: disable an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n}    add: add a new item${\n}    del: delete one or more items${\n}    set: change the value of one or more options of one or more items${\n} switch: switch any occurence of an item in the list by another one${\n}   list: list all options from all items${\n} iclear: delete all items${\n}    pop: remove the last item in the list${\n}   push: put one or more items at the end of the list${\n}  shift: remove the first item in the list${\n} lclear: clear the list${\n} remove: remove one or more items in the list${\n}unshift: put one or more items at the beginning of the list${\n}replace: replace the list${\n}feature: name of an option that change the behavior of ${split:1,_,,${tg_trigger_name}} (powerline, filtered_lines, ${if:${tg_trigger_name}==newsmon_tools?keep_url, keep_date:hidden_channels})${\n}   item: name of an item${\n}    pos: 'start' to insert the item at the start of the list, 'end' to add the item at the end of the list${\n}min_len: minimum length of an item (content is evaluated)${\n}max_len: maximum length of an item (content is evaluated)${\n}     fg: foreground color of the item (content is evaluated)${\n}     bg: background color of the item (content is evaluated)${\n}    sep: foreground color for the separator of the item (content is evaluated)${\n}content: content of the item (content is evaluated)${\n}   cond: conditions to display the item (content is evaluated)${\n} option: name of an item option (min_length, max_length, fg, bg, separator, content and conditions)${\n}  value: value of an option (content is evaluated)${\n}${\n}There are three kinds of commands. The commands that manipulates items, those that manipulates the list of displayed items and finally, the commands that manipulates the differents features. In order for an item to be displayed, it must be both in the list and the conditions of the item must evaluates to true when tested against the message.${if:${tg_trigger_name}==newsmon_tools? In addition to the variables available in the print trigger, my_site_and_sections, my_site, my_title, my_date, my_url, my_url_encode.}${\n}${\n}Exemples:${\n}  Add three items and display them:${\n}    /${tg_trigger_name} enable powerline${\n}    /${tg_trigger_name} add serv end ${\x22}3${\x22} ${\x22}3${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${server}}${\x22}${\n}    /${tg_trigger_name} add chan end ${\x22}4${\x22} ${\x22}4${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${split:1,#,keep_eol+strip_left,${channel}}}${\x22}${\n}    /${tg_trigger_name} add nick end ${\x22}5${\x22} ${\x22}5${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${tg_tag_nick}}${\x22}${\n}  ${color:white,${if:${tg_trigger_name}==highmon_tools?124:24}} fr… ${color:black}${color:white} wee… ${color:black}${color:white} r3m   ${color:${if:${tg_trigger_name}==highmon_tools?124:24},default};enable|disable|toggle powerline|filtered_lines|${if:${tg_trigger_name}==newsmon_tools?keep_url|keep_date:hidden_channels}|%* || set date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|serv,chan,nick|serv_hl,date_hl,nick_hl fg|bg|separator|min_length|max_length|content|conditions || add date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl ${\x22}${\x22}|start|end || switch date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|serv,chan,nick|serv_hl,date_hl,nick_hl|%* || list|iclear|pop|shift|lclear || del|push|remove|replace|unshift date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|my_site|%*"
/trigger set chanmon_tools conditions "${tg_argv_eol1} =~ ^(enable|disable|toggle|del|unshift|push|replace|remove) +[[:alnum:]_ ]+$ || ${tg_argv_eol1} =~ ^switch +[[:alnum:]_]+ +[[:alnum:]_]+$ || ${tg_argv_eol1} =~ ^add +([[:alnum:]_]+,?)+( |$) || ${tg_argv_eol1} =~ ^set +([[:alnum:]_]+,?)+ +([[:alnum:]_]+,?)+( |$) || ${tg_argv_eol1} =~ ^(list|iclear|shift|pop|lclear)$"
/trigger set chanmon_tools regex "/.*/${tg_trigger_name}/my_buffer /_tools$//my_buffer /.*/${tg_argv1}/my_action /\$\{|;/${\x5cx5c}${re:0}/tg_argv_eol4 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv4 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv5 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv6 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv7 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv8 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv9 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv10 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv11 /.*/${if:${my_action}=~^(add|set)$?${tg_argv2}:${if:${my_action}=~^(del|push|remove|replace|switch|unshift)$?${tg_argv_eol2}}}/my_items / +/,/my_items /^,|,$//my_items /.*/${if:${my_action}==add?${if:${tg_shell_argv3}==start?unshift:${if:${tg_shell_argv3}==end?push}}:${if:${my_action}==del?remove:${if:${my_action}=~^[il]clear?clear:${if:${my_action}=~^(pop|push|shift|remove|unshift|replace|switch)$?${my_action}}}}}/my_list_action /.*/${plugins.var.${my_buffer}.list}/my_list /[^,]+/${if:${re:0}=~^[[:alnum:]_]+$?${re:0}}/my_list /.+/,${re:0},/my_list /[^,]+(.*)/${if:${my_list_action}==shift?${re:1}:${re:0}}/my_list /(.*),[^,]+/${if:${my_list_action}==pop?${re:1}:${re:0}}/my_list /.*/${if:${my_list_action}==unshift?${my_items},}${re:0}/my_list /.*/${re:0}${if:${my_list_action}==push?,${my_items}}/my_list /[^,]+/${if:${my_list_action}==remove&&,${my_items},=-,${re:0},?:${re:0}}/my_list /[^,]+/${if:${my_list_action}==switch&&${re:0}==${split:1,,,${my_items}}?${split:2,,,${my_items}}:${re:0}}/my_list /.*/${if:${my_list_action}==replace?${my_items}:${re:0}}/my_list /.*/${if:${my_list_action}==clear?:${re:0}}/my_list /,+/,/my_list /^,|,$//my_list /.*/${if:${my_action}=~^(enable|disable|toggle)$?${tg_argv_eol2}}/my_look_cmds ===([^ ]+) *===/mute /set plugins.var.${my_buffer}.look.${re:1} ${if:${my_action}==disable?0:${if:${my_action}==enable?1:${if:${plugins.var.${my_buffer}.look.${re:1}}!=?0:1}}};===my_look_cmds /$/${my_look_cmds}/my_cmds_to_run /.*/${if:${my_action}==set?${my_items},}/my_set_cmds /.*/${if:${my_action}==set?${tg_argv3},}/my_set_opts /,+/,/my_set_opts /[^,]+,/${repeat:${split:count,,strip_right,${my_set_opts}},${re:0}}/my_set_cmds /.+/${repeat:${split:count,,strip_right,${my_items}},${re:0}}/my_set_opts ===([^,]+),===/mute /set plugins.var.${my_buffer}.item.${re:1}.${split:${re:repl_index},,,${my_set_opts}} '${tg_argv_eol4}';===my_set_cmds /$/${my_set_cmds}/my_cmds_to_run /.*/${if:${my_action}==add?${my_items},}/my_add_cmds ===[^,]+,===/mute /set plugins.var.${my_buffer}.item.${re:0}===my_add_cmds ===([^,]+),===${re:1}.min_length '${tg_shell_argv4}';${re:1}.max_length '${tg_shell_argv5}';${re:1}.fg '${tg_shell_argv6}';${re:1}.bg '${tg_shell_argv7}';${re:1}.separator '${tg_shell_argv8}';${re:1}.content '${tg_shell_argv9}';${re:1}.conditions '${tg_shell_argv10}';===my_add_cmds /$/${my_add_cmds}/my_cmds_to_run ===$===${if:${my_action}==list?/mute /set plugins.var.${my_buffer}.item.*;}===my_cmds_to_run /.*/${if:${my_action}==del?${my_items}}/my_del_cmds ===([^,]+),?===/mute /unset -mask plugins.var.${my_buffer}.item.${re:1}.*;===my_del_cmds /$/${my_del_cmds}/my_cmds_to_run ===$===${if:${my_action}==iclear?/mute /unset -mask plugins.var.${my_buffer}.item.*;}===my_cmds_to_run ===$===${if:${my_list_action}!=?/mute /set plugins.var.${my_buffer}.list '${my_list}';}===my_cmds_to_run"
/trigger set chanmon_tools command "/command -buffer core.weechat * /eval -s ${my_cmds_to_run}"

/trigger addreplace chanmon print "*;irc_privmsg,matrix_message,matrix_text"
/trigger set chanmon conditions "${buffer.local_variables.type} == channel && ${buffer.local_variables.no_${tg_trigger_name}_like} == && (${plugins.var.${tg_trigger_name}.look.filtered_lines} != || ${plugins.var.${tg_trigger_name}.look.filtered_lines} == && ${tg_displayed} !=) && (${plugins.var.${tg_trigger_name}.look.hidden_channels} != || ${plugins.var.${tg_trigger_name}.look.hidden_channels} == && ${buffer.hidden} ==)"
/trigger set chanmon regex "/.*/${if:${buffer.local_variables.script_name}==matrix||${buffer.local_variables.plugin}==matrix?nick_${base_encode:64,${tg_tag_nick}}:${tg_tags}}/tg_tags /.*/${plugins.var.${tg_trigger_name}.list}/my_list /[^,]+/${if:${re:0}=~^[[:alnum:]_]+$?${re:0}}/my_list /[^,]+/plugins.var.${tg_trigger_name}.item.${re:0}/my_list /[^,]+/${if:${length:${${re:0}.conditions}}==||${eval_cond:${${re:0}.conditions}}?${re:0}}/my_list /,+/,/my_list /^,|,$//my_list /.*/${my_list}/my_bgs /[^,]+/${base_encode:64,${eval:${${re:0}.bg}}}/my_bgs /$/,${base_encode:64,default}/my_bgs /([^,]+)(,|$)/${define:my_fg,${eval:${${re:1}.fg}}}${define:my_bg,${base_decode:64,${split:${re:repl_index},,,${my_bgs}}}}${define:my_separator,${eval:${${re:1}.separator}}}${define:my_min_length,${eval:${${re:1}.min_length}}}${define:my_max_length,${eval:${${re:1}.max_length}}}${define:my_content,${eval:${${re:1}.content}}}${define:my_next_bg,${base_decode:64,${split:${calc:${re:repl_index}+1},,,${my_bgs}}}}${color:${my_fg},${my_bg}} ${cutscr:+${if:${split:1,0,keep_eol+strip_left,${my_max_length}}!~^[1-9][0-9]*$?${calc:${lengthscr:${my_content}}+1}:${my_max_length}},…,${my_content}}${repeat:${calc:${my_min_length}-${lengthscr:${my_content}}}, }${color:${my_fg},${my_bg}} ${if:${plugins.var.${tg_trigger_name}.look.powerline}!=?${if:${color:${my_bg}}==${color:${my_next_bg}}?${color:${my_separator}}:${color:${my_bg},${my_next_bg}}${color:reset}}:${color:reset} }/my_list /.+/${re:0} /my_list"
/trigger set chanmon command "/print -newbuffer ${tg_trigger_name} -tags ${tg_tags} \t${my_list}${tg_message}"

/chanmon_tools enable powerline
/chanmon_tools add date "" "5" "5" "white" "24" "24" "${color:underline}${cut:5,,${split:-1, ,,${tg_date}}}" "${tg_highlight}=="
/chanmon_tools add serv "" "2" "2" "white" "31" "24" "${color:underline}${server}" "${tg_highlight}=="
/chanmon_tools add chan "" "4" "4" "white" "31" "24" "${color:underline}${split:1,#,keep_eol+strip_left,${channel}}" "${tg_highlight}=="
/chanmon_tools add nick "" "5" "5" "white" "31" "24" "${color:underline}${if:${tg_tags}=~,irc_action,?    *:${tg_tag_nick}}" "${tg_highlight}=="
/chanmon_tools add date_hl "" "5" "5" "white" "52" "52" "${color:underline}${cut:5,,${split:-1, ,,${tg_date}}}" "${tg_highlight}!="
/chanmon_tools add serv_hl "" "2" "2" "white" "124" "52" "${color:underline}${server}" "${tg_highlight}!="
/chanmon_tools add chan_hl "" "4" "4" "white" "124" "52" "${color:underline}${split:1,#,keep_eol+strip_left,${channel}}" "${tg_highlight}!="
/chanmon_tools add nick_hl "" "5" "5" "white" "124" "52" "${color:underline}${if:${tg_tags}=~,irc_action,?    *:${tg_tag_nick}}" "${tg_highlight}!="
/chanmon_tools replace date serv chan nick date_hl serv_hl chan_hl nick_hl

The first trigger create the chanmon_tools command. The second trigger send all irc_privmsg or matrix_message from all channels to the core.chanmon buffer. Then we create the different items for our powerline bar. Don't use default for the bg of any items, the bar will be ugly, I could use color:reverse to overcome that but weechat-android and glowing-bear doesnt support reverse and i want the output to be good in those relay client too.

Highlight Monitor

≥ WeeChat 3.4 for ${define:...}

WeeChat Screenshot

[trigger]  /highmon_tools  enable|disable|toggle <feature> [<feature>...]
                           add <item>,[<item>...] ["<pos>" ["<min_len>" ["<max_len>" ["<fg>" ["<bg>" ["<sep>" ["<content>" ["<cond>"]]]]]]]]
                           set <item>,[<item>...] <option>,[<option>...] [<value>]
                           switch <item> <item>
                           list|iclear|pop|shift|lclear
                           del|push|remove|replace|unshift <item> [<item>...]

this is the command syntax

/buffer add highmon
/eval /set weechat.startup.command_after_plugins ${weechat.startup.command_after_plugins}${if:${weechat.startup.command_after_plugins}!=?;}/buffer add highmon
/buffer_autoset add core.highmon notify none
/buffer_autoset add core.highmon highlight_words -
/buffer_autoset add core.highmon title Highlight Monitor
/buffer_autoset add core.highmon time_for_each_line 0

/trigger addreplace highmon_tools command "highmon_tools;manage the ${split:1,_,,${tg_trigger_name}} buffer;enable|disable|toggle <feature> [<feature>...] || add <item>,[<item>...] [${\x22}<pos>${\x22} [${\x22}<min_len>${\x22} [${\x22}<max_len>${\x22} [${\x22}<fg>${\x22} [${\x22}<bg>${\x22} [${\x22}<sep>${\x22} [${\x22}<content>${\x22} [${\x22}<cond>${\x22}]]]]]]]] || set <item>,[<item>...] <option>,[<option>...] [<value>] || switch <item> <item> || list|iclear|pop|shift|lclear || del|push|remove|replace|unshift <item> [<item>...]; enable: enable an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n} toggle: toggle an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n}disable: disable an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n}    add: add a new item${\n}    del: delete one or more items${\n}    set: change the value of one or more options of one or more items${\n} switch: switch any occurence of an item in the list by another one${\n}   list: list all options from all items${\n} iclear: delete all items${\n}    pop: remove the last item in the list${\n}   push: put one or more items at the end of the list${\n}  shift: remove the first item in the list${\n} lclear: clear the list${\n} remove: remove one or more items in the list${\n}unshift: put one or more items at the beginning of the list${\n}replace: replace the list${\n}feature: name of an option that change the behavior of ${split:1,_,,${tg_trigger_name}} (powerline, filtered_lines, ${if:${tg_trigger_name}==newsmon_tools?keep_url, keep_date:hidden_channels})${\n}   item: name of an item${\n}    pos: 'start' to insert the item at the start of the list, 'end' to add the item at the end of the list${\n}min_len: minimum length of an item (content is evaluated)${\n}max_len: maximum length of an item (content is evaluated)${\n}     fg: foreground color of the item (content is evaluated)${\n}     bg: background color of the item (content is evaluated)${\n}    sep: foreground color for the separator of the item (content is evaluated)${\n}content: content of the item (content is evaluated)${\n}   cond: conditions to display the item (content is evaluated)${\n} option: name of an item option (min_length, max_length, fg, bg, separator, content and conditions)${\n}  value: value of an option (content is evaluated)${\n}${\n}There are three kinds of commands. The commands that manipulates items, those that manipulates the list of displayed items and finally, the commands that manipulates the differents features. In order for an item to be displayed, it must be both in the list and the conditions of the item must evaluates to true when tested against the message.${if:${tg_trigger_name}==newsmon_tools? In addition to the variables available in the print trigger, my_site_and_sections, my_site, my_title, my_date, my_url, my_url_encode.}${\n}${\n}Exemples:${\n}  Add three items and display them:${\n}    /${tg_trigger_name} enable powerline${\n}    /${tg_trigger_name} add serv end ${\x22}3${\x22} ${\x22}3${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${server}}${\x22}${\n}    /${tg_trigger_name} add chan end ${\x22}4${\x22} ${\x22}4${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${split:1,#,keep_eol+strip_left,${channel}}}${\x22}${\n}    /${tg_trigger_name} add nick end ${\x22}5${\x22} ${\x22}5${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${tg_tag_nick}}${\x22}${\n}  ${color:white,${if:${tg_trigger_name}==highmon_tools?124:24}} fr… ${color:black}${color:white} wee… ${color:black}${color:white} r3m   ${color:${if:${tg_trigger_name}==highmon_tools?124:24},default};enable|disable|toggle powerline|filtered_lines|${if:${tg_trigger_name}==newsmon_tools?keep_url|keep_date:hidden_channels}|%* || set date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|serv,chan,nick|serv_hl,date_hl,nick_hl fg|bg|separator|min_length|max_length|content|conditions || add date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl ${\x22}${\x22}|start|end || switch date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|serv,chan,nick|serv_hl,date_hl,nick_hl|%* || list|iclear|pop|shift|lclear || del|push|remove|replace|unshift date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|my_site|%*"
/trigger set highmon_tools conditions "${tg_argv_eol1} =~ ^(enable|disable|toggle|del|unshift|push|replace|remove) +[[:alnum:]_ ]+$ || ${tg_argv_eol1} =~ ^switch +[[:alnum:]_]+ +[[:alnum:]_]+$ || ${tg_argv_eol1} =~ ^add +([[:alnum:]_]+,?)+( |$) || ${tg_argv_eol1} =~ ^set +([[:alnum:]_]+,?)+ +([[:alnum:]_]+,?)+( |$) || ${tg_argv_eol1} =~ ^(list|iclear|shift|pop|lclear)$"
/trigger set highmon_tools regex "/.*/${tg_trigger_name}/my_buffer /_tools$//my_buffer /.*/${tg_argv1}/my_action /\$\{|;/${\x5cx5c}${re:0}/tg_argv_eol4 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv4 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv5 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv6 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv7 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv8 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv9 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv10 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv11 /.*/${if:${my_action}=~^(add|set)$?${tg_argv2}:${if:${my_action}=~^(del|push|remove|replace|switch|unshift)$?${tg_argv_eol2}}}/my_items / +/,/my_items /^,|,$//my_items /.*/${if:${my_action}==add?${if:${tg_shell_argv3}==start?unshift:${if:${tg_shell_argv3}==end?push}}:${if:${my_action}==del?remove:${if:${my_action}=~^[il]clear?clear:${if:${my_action}=~^(pop|push|shift|remove|unshift|replace|switch)$?${my_action}}}}}/my_list_action /.*/${plugins.var.${my_buffer}.list}/my_list /[^,]+/${if:${re:0}=~^[[:alnum:]_]+$?${re:0}}/my_list /.+/,${re:0},/my_list /[^,]+(.*)/${if:${my_list_action}==shift?${re:1}:${re:0}}/my_list /(.*),[^,]+/${if:${my_list_action}==pop?${re:1}:${re:0}}/my_list /.*/${if:${my_list_action}==unshift?${my_items},}${re:0}/my_list /.*/${re:0}${if:${my_list_action}==push?,${my_items}}/my_list /[^,]+/${if:${my_list_action}==remove&&,${my_items},=-,${re:0},?:${re:0}}/my_list /[^,]+/${if:${my_list_action}==switch&&${re:0}==${split:1,,,${my_items}}?${split:2,,,${my_items}}:${re:0}}/my_list /.*/${if:${my_list_action}==replace?${my_items}:${re:0}}/my_list /.*/${if:${my_list_action}==clear?:${re:0}}/my_list /,+/,/my_list /^,|,$//my_list /.*/${if:${my_action}=~^(enable|disable|toggle)$?${tg_argv_eol2}}/my_look_cmds ===([^ ]+) *===/mute /set plugins.var.${my_buffer}.look.${re:1} ${if:${my_action}==disable?0:${if:${my_action}==enable?1:${if:${plugins.var.${my_buffer}.look.${re:1}}!=?0:1}}};===my_look_cmds /$/${my_look_cmds}/my_cmds_to_run /.*/${if:${my_action}==set?${my_items},}/my_set_cmds /.*/${if:${my_action}==set?${tg_argv3},}/my_set_opts /,+/,/my_set_opts /[^,]+,/${repeat:${split:count,,strip_right,${my_set_opts}},${re:0}}/my_set_cmds /.+/${repeat:${split:count,,strip_right,${my_items}},${re:0}}/my_set_opts ===([^,]+),===/mute /set plugins.var.${my_buffer}.item.${re:1}.${split:${re:repl_index},,,${my_set_opts}} '${tg_argv_eol4}';===my_set_cmds /$/${my_set_cmds}/my_cmds_to_run /.*/${if:${my_action}==add?${my_items},}/my_add_cmds ===[^,]+,===/mute /set plugins.var.${my_buffer}.item.${re:0}===my_add_cmds ===([^,]+),===${re:1}.min_length '${tg_shell_argv4}';${re:1}.max_length '${tg_shell_argv5}';${re:1}.fg '${tg_shell_argv6}';${re:1}.bg '${tg_shell_argv7}';${re:1}.separator '${tg_shell_argv8}';${re:1}.content '${tg_shell_argv9}';${re:1}.conditions '${tg_shell_argv10}';===my_add_cmds /$/${my_add_cmds}/my_cmds_to_run ===$===${if:${my_action}==list?/mute /set plugins.var.${my_buffer}.item.*;}===my_cmds_to_run /.*/${if:${my_action}==del?${my_items}}/my_del_cmds ===([^,]+),?===/mute /unset -mask plugins.var.${my_buffer}.item.${re:1}.*;===my_del_cmds /$/${my_del_cmds}/my_cmds_to_run ===$===${if:${my_action}==iclear?/mute /unset -mask plugins.var.${my_buffer}.item.*;}===my_cmds_to_run ===$===${if:${my_list_action}!=?/mute /set plugins.var.${my_buffer}.list '${my_list}';}===my_cmds_to_run"
/trigger set highmon_tools command "/command -buffer core.weechat * /eval -s ${my_cmds_to_run}"

/trigger addreplace highmon print "*;irc_privmsg,matrix_message,matrix_text"
/trigger set highmon conditions "${tg_highlight} != && ${buffer.local_variables.type} == channel && ${buffer.local_variables.no_${tg_trigger_name}_like} == && (${plugins.var.${tg_trigger_name}.look.filtered_lines} != || ${plugins.var.${tg_trigger_name}.look.filtered_lines} == && ${tg_displayed} !=) && (${plugins.var.${tg_trigger_name}.look.hidden_channels} != || ${plugins.var.${tg_trigger_name}.look.hidden_channels} == && ${buffer.hidden} ==)"
/trigger set highmon regex "/.*/${if:${buffer.local_variables.script_name}==matrix||${buffer.local_variables.plugin}==matrix?nick_${base_encode:64,${tg_tag_nick}}:${tg_tags}}/tg_tags /.*/${plugins.var.${tg_trigger_name}.list}/my_list /[^,]+/${if:${re:0}=~^[[:alnum:]_]+$?${re:0}}/my_list /[^,]+/plugins.var.${tg_trigger_name}.item.${re:0}/my_list /[^,]+/${if:${length:${${re:0}.conditions}}==||${eval_cond:${${re:0}.conditions}}?${re:0}}/my_list /,+/,/my_list /^,|,$//my_list /.*/${my_list}/my_bgs /[^,]+/${base_encode:64,${eval:${${re:0}.bg}}}/my_bgs /$/,${base_encode:64,default}/my_bgs /([^,]+)(,|$)/${define:my_fg,${eval:${${re:1}.fg}}}${define:my_bg,${base_decode:64,${split:${re:repl_index},,,${my_bgs}}}}${define:my_separator,${eval:${${re:1}.separator}}}${define:my_min_length,${eval:${${re:1}.min_length}}}${define:my_max_length,${eval:${${re:1}.max_length}}}${define:my_content,${eval:${${re:1}.content}}}${define:my_next_bg,${base_decode:64,${split:${calc:${re:repl_index}+1},,,${my_bgs}}}}${color:${my_fg},${my_bg}} ${cutscr:+${if:${split:1,0,keep_eol+strip_left,${my_max_length}}!~^[1-9][0-9]*$?${calc:${lengthscr:${my_content}}+1}:${my_max_length}},…,${my_content}}${repeat:${calc:${my_min_length}-${lengthscr:${my_content}}}, }${color:${my_fg},${my_bg}} ${if:${plugins.var.${tg_trigger_name}.look.powerline}!=?${if:${color:${my_bg}}==${color:${my_next_bg}}?${color:${my_separator}}:${color:${my_bg},${my_next_bg}}${color:reset}}:${color:reset} }/my_list /.+/${re:0} /my_list"
/trigger set highmon command "/print -newbuffer ${tg_trigger_name} -tags ${tg_tags} \t${my_list}${tg_message}"

/highmon_tools enable powerline hidden_channels
/highmon_tools add date "" "5" "5" "white" "52" "52" "${color:underline}${cut:5,,${split:-1, ,,${tg_date}}}" "${tg_highlight}!="
/highmon_tools add serv "" "2" "2" "white" "124" "52" "${color:underline}${server}" "${tg_highlight}!="
/highmon_tools add chan "" "4" "4" "white" "124" "52" "${color:underline}${split:1,#,keep_eol+strip_left,${channel}}" "${tg_highlight}!="
/highmon_tools add nick "" "5" "5" "white" "124" "52" "${color:underline}${if:${tg_tags}=~,irc_action,?    *:${tg_tag_nick}}" "${tg_highlight}!="
/highmon_tools replace date serv chan nick

The first trigger create the highmon_tools command. The second trigger send all channel highlights to the core.highmon buffer. Then we create the different items for our powerline bar. Don't use default for the bg of any items, the bar will be ugly, I could use color:reverse to overcome that but weechat-android and glowing-bear doesnt support reverse and i want the output to be good in those relay client too.

News monitor

≥ WeeChat 3.4 for ${define:...}

WeeChat Screenshot

[trigger]  /newsmon_tools  enable|disable|toggle <feature> [<feature>...]
                           add <item>,[<item>...] ["<pos>" ["<min_len>" ["<max_len>" ["<fg>" ["<bg>" ["<sep>" ["<content>" ["<cond>"]]]]]]]]
                           set <item>,[<item>...] <option>,[<option>...] [<value>]
                           switch <item> <item>
                           list|iclear|pop|shift|lclear
                           del|push|remove|replace|unshift <item> [<item>...]

this is the command syntax

/buffer add newsmon
/eval /set weechat.startup.command_after_plugins ${weechat.startup.command_after_plugins}${if:${weechat.startup.command_after_plugins}!=?;}/buffer add newsmon
/buffer_autoset add core.newsmon notify none
/buffer_autoset add core.newsmon highlight_words -
/buffer_autoset add core.newsmon title News Monitor
/buffer_autoset add core.newsmon time_for_each_line 0
/eval /buffer_autoset add ${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.##news} notify none
/eval /buffer_autoset add ${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.##news} hidden 1

/eval /filter addreplace news_interest ${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.##news} irc_privmsg+nick_newsly*,matrix_message+nick_newsly*,matrix_text+nick_newsly* !(^\[(Wired|EFF Updates|techdirt|TorrentFreak|Science Daily|Hacker News|CNET|phoronix|Ars Technica|The Intercept|france24|Radio-Canada Nouvelles|Journal du hacker|Futura Sciences|Reddit - /r/netsec|Huffington Post - Weird News)( -|\])|^\[[^]]+ - (Tech|Science)|\b(study|studies|climate)\b)

/trigger addreplace newsmon_tools command "newsmon_tools;manage the ${split:1,_,,${tg_trigger_name}} buffer;enable|disable|toggle <feature> [<feature>...] || add <item>,[<item>...] [${\x22}<pos>${\x22} [${\x22}<min_len>${\x22} [${\x22}<max_len>${\x22} [${\x22}<fg>${\x22} [${\x22}<bg>${\x22} [${\x22}<sep>${\x22} [${\x22}<content>${\x22} [${\x22}<cond>${\x22}]]]]]]]] || set <item>,[<item>...] <option>,[<option>...] [<value>] || switch <item> <item> || list|iclear|pop|shift|lclear || del|push|remove|replace|unshift <item> [<item>...]; enable: enable an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n} toggle: toggle an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n}disable: disable an option that change the behavior of ${split:1,_,,${tg_trigger_name}}${\n}    add: add a new item${\n}    del: delete one or more items${\n}    set: change the value of one or more options of one or more items${\n} switch: switch any occurence of an item in the list by another one${\n}   list: list all options from all items${\n} iclear: delete all items${\n}    pop: remove the last item in the list${\n}   push: put one or more items at the end of the list${\n}  shift: remove the first item in the list${\n} lclear: clear the list${\n} remove: remove one or more items in the list${\n}unshift: put one or more items at the beginning of the list${\n}replace: replace the list${\n}feature: name of an option that change the behavior of ${split:1,_,,${tg_trigger_name}} (powerline, filtered_lines, ${if:${tg_trigger_name}==newsmon_tools?keep_url, keep_date:hidden_channels})${\n}   item: name of an item${\n}    pos: 'start' to insert the item at the start of the list, 'end' to add the item at the end of the list${\n}min_len: minimum length of an item (content is evaluated)${\n}max_len: maximum length of an item (content is evaluated)${\n}     fg: foreground color of the item (content is evaluated)${\n}     bg: background color of the item (content is evaluated)${\n}    sep: foreground color for the separator of the item (content is evaluated)${\n}content: content of the item (content is evaluated)${\n}   cond: conditions to display the item (content is evaluated)${\n} option: name of an item option (min_length, max_length, fg, bg, separator, content and conditions)${\n}  value: value of an option (content is evaluated)${\n}${\n}There are three kinds of commands. The commands that manipulates items, those that manipulates the list of displayed items and finally, the commands that manipulates the differents features. In order for an item to be displayed, it must be both in the list and the conditions of the item must evaluates to true when tested against the message.${if:${tg_trigger_name}==newsmon_tools? In addition to the variables available in the print trigger, my_site_and_sections, my_site, my_title, my_date, my_url, my_url_encode.}${\n}${\n}Exemples:${\n}  Add three items and display them:${\n}    /${tg_trigger_name} enable powerline${\n}    /${tg_trigger_name} add serv end ${\x22}3${\x22} ${\x22}3${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${server}}${\x22}${\n}    /${tg_trigger_name} add chan end ${\x22}4${\x22} ${\x22}4${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${split:1,#,keep_eol+strip_left,${channel}}}${\x22}${\n}    /${tg_trigger_name} add nick end ${\x22}5${\x22} ${\x22}5${\x22} ${\x22}white${\x22} ${\x22}${if:${tg_trigger_name}==highmon_tools?124:24}${\x22} ${\x22}black${\x22} ${\x22}${raw:${tg_tag_nick}}${\x22}${\n}  ${color:white,${if:${tg_trigger_name}==highmon_tools?124:24}} fr… ${color:black}${color:white} wee… ${color:black}${color:white} r3m   ${color:${if:${tg_trigger_name}==highmon_tools?124:24},default};enable|disable|toggle powerline|filtered_lines|${if:${tg_trigger_name}==newsmon_tools?keep_url|keep_date:hidden_channels}|%* || set date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|serv,chan,nick|serv_hl,date_hl,nick_hl fg|bg|separator|min_length|max_length|content|conditions || add date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl ${\x22}${\x22}|start|end || switch date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|serv,chan,nick|serv_hl,date_hl,nick_hl|%* || list|iclear|pop|shift|lclear || del|push|remove|replace|unshift date|serv|chan|nick|date_hl|serv_hl|chan_hl|nick_hl|my_site|%*"
/trigger set newsmon_tools conditions "${tg_argv_eol1} =~ ^(enable|disable|toggle|del|unshift|push|replace|remove) +[[:alnum:]_ ]+$ || ${tg_argv_eol1} =~ ^switch +[[:alnum:]_]+ +[[:alnum:]_]+$ || ${tg_argv_eol1} =~ ^add +([[:alnum:]_]+,?)+( |$) || ${tg_argv_eol1} =~ ^set +([[:alnum:]_]+,?)+ +([[:alnum:]_]+,?)+( |$) || ${tg_argv_eol1} =~ ^(list|iclear|shift|pop|lclear)$"
/trigger set newsmon_tools regex "/.*/${tg_trigger_name}/my_buffer /_tools$//my_buffer /.*/${tg_argv1}/my_action /\$\{|;/${\x5cx5c}${re:0}/tg_argv_eol4 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv4 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv5 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv6 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv7 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv8 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv9 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv10 /\$\{|;/${\x5cx5c}${re:0}/tg_shell_argv11 /.*/${if:${my_action}=~^(add|set)$?${tg_argv2}:${if:${my_action}=~^(del|push|remove|replace|switch|unshift)$?${tg_argv_eol2}}}/my_items / +/,/my_items /^,|,$//my_items /.*/${if:${my_action}==add?${if:${tg_shell_argv3}==start?unshift:${if:${tg_shell_argv3}==end?push}}:${if:${my_action}==del?remove:${if:${my_action}=~^[il]clear?clear:${if:${my_action}=~^(pop|push|shift|remove|unshift|replace|switch)$?${my_action}}}}}/my_list_action /.*/${plugins.var.${my_buffer}.list}/my_list /[^,]+/${if:${re:0}=~^[[:alnum:]_]+$?${re:0}}/my_list /.+/,${re:0},/my_list /[^,]+(.*)/${if:${my_list_action}==shift?${re:1}:${re:0}}/my_list /(.*),[^,]+/${if:${my_list_action}==pop?${re:1}:${re:0}}/my_list /.*/${if:${my_list_action}==unshift?${my_items},}${re:0}/my_list /.*/${re:0}${if:${my_list_action}==push?,${my_items}}/my_list /[^,]+/${if:${my_list_action}==remove&&,${my_items},=-,${re:0},?:${re:0}}/my_list /[^,]+/${if:${my_list_action}==switch&&${re:0}==${split:1,,,${my_items}}?${split:2,,,${my_items}}:${re:0}}/my_list /.*/${if:${my_list_action}==replace?${my_items}:${re:0}}/my_list /.*/${if:${my_list_action}==clear?:${re:0}}/my_list /,+/,/my_list /^,|,$//my_list /.*/${if:${my_action}=~^(enable|disable|toggle)$?${tg_argv_eol2}}/my_look_cmds ===([^ ]+) *===/mute /set plugins.var.${my_buffer}.look.${re:1} ${if:${my_action}==disable?0:${if:${my_action}==enable?1:${if:${plugins.var.${my_buffer}.look.${re:1}}!=?0:1}}};===my_look_cmds /$/${my_look_cmds}/my_cmds_to_run /.*/${if:${my_action}==set?${my_items},}/my_set_cmds /.*/${if:${my_action}==set?${tg_argv3},}/my_set_opts /,+/,/my_set_opts /[^,]+,/${repeat:${split:count,,strip_right,${my_set_opts}},${re:0}}/my_set_cmds /.+/${repeat:${split:count,,strip_right,${my_items}},${re:0}}/my_set_opts ===([^,]+),===/mute /set plugins.var.${my_buffer}.item.${re:1}.${split:${re:repl_index},,,${my_set_opts}} '${tg_argv_eol4}';===my_set_cmds /$/${my_set_cmds}/my_cmds_to_run /.*/${if:${my_action}==add?${my_items},}/my_add_cmds ===[^,]+,===/mute /set plugins.var.${my_buffer}.item.${re:0}===my_add_cmds ===([^,]+),===${re:1}.min_length '${tg_shell_argv4}';${re:1}.max_length '${tg_shell_argv5}';${re:1}.fg '${tg_shell_argv6}';${re:1}.bg '${tg_shell_argv7}';${re:1}.separator '${tg_shell_argv8}';${re:1}.content '${tg_shell_argv9}';${re:1}.conditions '${tg_shell_argv10}';===my_add_cmds /$/${my_add_cmds}/my_cmds_to_run ===$===${if:${my_action}==list?/mute /set plugins.var.${my_buffer}.item.*;}===my_cmds_to_run /.*/${if:${my_action}==del?${my_items}}/my_del_cmds ===([^,]+),?===/mute /unset -mask plugins.var.${my_buffer}.item.${re:1}.*;===my_del_cmds /$/${my_del_cmds}/my_cmds_to_run ===$===${if:${my_action}==iclear?/mute /unset -mask plugins.var.${my_buffer}.item.*;}===my_cmds_to_run ===$===${if:${my_list_action}!=?/mute /set plugins.var.${my_buffer}.list '${my_list}';}===my_cmds_to_run"
/trigger set newsmon_tools command "/command -buffer core.weechat * /eval -s ${my_cmds_to_run}"

/eval /trigger addreplace newsmon print "${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.##news};irc_privmsg,matrix_message,matrix_text,debug_newsmon"
/trigger set newsmon conditions "${plugins.var.${tg_trigger_name}.look.filtered_lines} != || ${plugins.var.${tg_trigger_name}.look.filtered_lines} == && ${tg_displayed} !="
/trigger set newsmon regex "/.*/${tg_message_nocolor}/my_site_and_sections /.*/${tg_message_nocolor}/my_title /^\[([^]]+)\].*/${re:1}/my_site_and_sections / - /|/my_site_and_sections /^\[[^]]+\] (.*)/${re:1}/my_title /.*/${split:-2, ,,${my_title}}/my_url /.*/${split:-1, ,,${my_title}}/my_date / [^ ]+ [^ ]+$//my_title /.*/url_${base_encode:64,${my_url}}/my_url_encode_tag /\+/#/my_url_encode_tag /.*/${if:${buffer.local_variables.script_name}==matrix||${buffer.local_variables.plugin}==matrix?nick_${base_encode:64,${tg_tag_nick}}:${tg_tags}}/tg_tags /.*/${plugins.var.${tg_trigger_name}.list}/my_list /[^,]+/${if:${re:0}=~^[[:alnum:]_]+$?${re:0}}/my_list /[^,]+/plugins.var.${tg_trigger_name}.item.${re:0}/my_list /[^,]+/${if:${length:${${re:0}.conditions}}==||${eval_cond:${${re:0}.conditions}}?${re:0}}/my_list /,+/,/my_list /^,|,$//my_list /.*/${my_list}/my_bgs /[^,]+/${base_encode:64,${eval:${${re:0}.bg}}}/my_bgs /$/,${base_encode:64,default}/my_bgs /([^,]+)(,|$)/${define:my_fg,${eval:${${re:1}.fg}}}${define:my_bg,${base_decode:64,${split:${re:repl_index},,,${my_bgs}}}}${define:my_separator,${eval:${${re:1}.separator}}}${define:my_min_length,${eval:${${re:1}.min_length}}}${define:my_max_length,${eval:${${re:1}.max_length}}}${define:my_content,${eval:${${re:1}.content}}}${define:my_next_bg,${base_decode:64,${split:${calc:${re:repl_index}+1},,,${my_bgs}}}}${color:${my_fg},${my_bg}} ${cutscr:+${if:${split:1,0,keep_eol+strip_left,${my_max_length}}!~^[1-9][0-9]*$?${calc:${lengthscr:${my_content}}+1}:${my_max_length}},…,${my_content}}${repeat:${calc:${my_min_length}-${lengthscr:${my_content}}}, }${color:${my_fg},${my_bg}} ${if:${plugins.var.${tg_trigger_name}.look.powerline}!=?${if:${color:${my_bg}}==${color:${my_next_bg}}?${color:${my_separator}}:${color:${my_bg},${my_next_bg}}${color:reset}}:${color:reset} }/my_list /.+/${re:0} /my_list"
/trigger set newsmon command "/print -newbuffer ${tg_trigger_name} -tags ${tg_tags},${my_url_encode_tag} \t${my_list}${my_title}${if:${plugins.var.newsmon.look.keep_url}!=? ${my_url}}${if:${plugins.var.newsmon.look.keep_date}!=? ${my_date}}"

/set plugins.var.my_newsmon_colors 1,4,9,10,12,28,29,30,31,34,35,38,39,58,64,65,70,75,94,95,96,98,100,105,106,130,132,133,135,136,138,141,160,161,162,165,166,167,168,169,172,200,202,203,204,206
/newsmon_tools enable powerline
/newsmon_tools add site_name "" "0" "${calc:10+${if:${lengthscr:${split:2,|,,${my_site_and_sections}}}==?4:${if:${lengthscr:${split:2,|,,${my_site_and_sections}}}<7?7-${lengthscr:${split:2,|,,${my_site_and_sections}}}}}}" "white" "${info:nick_color_name,${my_site_and_sections};${plugins.var.my_newsmon_colors}}" "white" "${color:underline}${split:1,|,,${my_site_and_sections}}"
/newsmon_tools add site_first_section "" "0" "${calc:7+${if:${lengthscr:${split:1,|,,${my_site_and_sections}}}<10?10-${lengthscr:${split:1,|,,${my_site_and_sections}}}}}" "white" "${info:nick_color_name,${my_site_and_sections};${plugins.var.my_newsmon_colors}}" "white" "${color:underline}${split:2,|,,${my_site_and_sections}}" "${split:2,|,,${my_site_and_sections}}!="
/newsmon_tools add site_no_first_section "" "0" "${calc:7+${if:${lengthscr:${split:1,|,,${my_site_and_sections}}}<10?10-${lengthscr:${split:1,|,,${my_site_and_sections}}}}}" "white" "${info:nick_color_name,${my_site_and_sections};${plugins.var.my_newsmon_colors}}" "white" "${color:underline}N/A" "${split:2,|,,${my_site_and_sections}}=="
/newsmon_tools replace site_name site_first_section site_no_first_section

This is the new version of the news monitor. In the past, the news was modified on the ##news channel itself but from now on the news are not modified on the ##news channel, they are sent to the core.newsmon buffer. There are a couple of reason for this choice like keeping the log for ##news clean. You can hide the ##news buffer with buffer_autoset.

The first trigger create the newsmon_tools command. The second trigger send all irc_privmsg and matrix_message from the ##news channel to the core.newsmon buffer. Then we create the different items for our powerline bar. Don't use default for the bg of any items, the bar will be ugly, I could use color:reverse to overcome that but weechat-android and glowing-bear doesnt support reverse and i want the output to be good in those relay client too.

/trigger addreplace news_click hsignal news_click
/trigger set news_click regex "/(^|.*,)url_([^,]+)(,.*|$)/${re:2}/_chat_line_tags /#/+/_chat_line_tags /.*/${base_decode:64,${re:0}}/_chat_line_tags"
/trigger set news_click command "/command -buffer ${buffer.full_name} core /input insert ${_chat_line_tags}\x20"

/key bindctxt cursor @chat(core.newsmon):i hsignal:news_click;/cursor stop

This trigger will be triggered when we press 'i' on a news in cursor mode (in general we invoke this with the middle mouse button). 'i' insert the URL in the input bar. If the URL is too long to view it all, simply press return to send it to the channel, which anyway is +m so nobody will see it, and press alt+l to go in bare mode (so you can click on the URL).

All monitors

/alias addcompletion %%chanmon_tools allmon_tools /chanmon_tools $*;/highmon_tools $*;/newsmon_tools $*

if you use all three monitors and you want to send the same command to all three, for example to enable powerline, use this alias.

/trigger addreplace update_monitors_title_item config plugins.var.chanmon.look.*;plugins.var.highmon.look.*;plugins.var.newsmon.look.*
/trigger set update_monitors_title_item regex "/.*/${tg_option}/my_monitor /^plugins.var.([^.]+).*/${re:1}/my_monitor /.*/${if:${my_monitor}==chanmon?Channels Monitor}${if:${my_monitor}==highmon?Highlights Monitor}${if:${my_monitor}==newsmon?News Monitor}/my_title /.*/powerline,Powerline,filtered_lines,Filtered Lines,${if:${my_monitor}==newsmon?keep_url,Keep URL,keep_date,Keep Date:hidden_channels,Hidden Channels},/my_items /([^,]+),([^,]+),/${if:${plugins.var.${my_monitor}.look.${re:1}}!=?${color:default}[${color:bar_fg}${re:2}${color:default}] }/my_items"
/trigger set update_monitors_title_item command "/command -buffer core.${my_monitor} * /buffer set title ${my_title} ${my_items}" 

/wait 3 /eval -s /allmon_tools look toggle powerline;/allmon_tools look toggle powerline

/eval /set weechat.startup.command_after_plugins ${weechat.startup.command_after_plugins}${if:${weechat.startup.command_after_plugins}!=?;}/wait 1 /allmon_tools look toggle powerline;/wait 1 /allmon_tools look toggle powerline

add this trigger if you want to display in the titles bars (titlesep & titlenosep) of monitors buffers which options are currently enabled (for example, if you have enabled powerline, [powerline] will be shown in the title bar). The last two lines are used to trigger the trigger now and on future launch of weechat.

Layouts

Layout main-control

/eval /window splith ${calc:9 / ${window[gui_current_window].win_height} * 100 // 1}
/buffer highmon
/window 1
/layout store main-control windows

a layout with two windows, window 1 is the bigger one and the main one used to display anything. Window 2 is suited to display monitors buffers like chanmon, highmon and newsmon

Layout main-control-conky

/window 2
/eval /window splitv ${if:${info:version_number}>=50397184?15:85}
/buffer exec.conky
/window 1
/layout store main-control-conky windows

a layout with three windows. Like the above one, the first window is the bigger one but window 2 is now smaller to make some room for window 3 which is use to display conky

Layout main-control-control2

/layout apply main-control
/window 2
/window splitv 50
/buffer core.newsmon
/window 1
/layout store main-control-control2 windows

a layout with three windows. Windows 2 and windows 3 are suited to display monitors buffers like chanmon, highmon and newsmon

Miscellaneous

nullpointer (https://0x0.st)

WeeChat Screenshot

/alias add nullpointer /exec -sh -hsignal nullpointer $* 2>&1 | curl -sfSF file=@- https://0x0.st
/trigger addreplace nullpointer hsignal nullpointer
/trigger set nullpointer regex "/\n//out"
/trigger set nullpointer command "/command -buffer ${buffer.full_name} core /input delete_line;/command -buffer ${buffer.full_name} core /input insert ${out}"

This allow you to type /nullpointer uptime for example, to send the output of the uptime command to 0x0.st. Your input bar content will be replaced by the url of the paste. This way you can visit the URL to see if there is sensitive information before giving the url to everyone. You may wonder why I didn't used something like: _/exec -sh -pipe "/input delete_line;/input insert " $* 2>&1 | curl -sF c=@- https://0x0.st Well If we use this, the input bar will be filled with the command and not the url.

Dev info

≥ WeeChat 3.1 for tg_trigger_name

WeeChat Screenshot

/alias del devinfo

/trigger addreplace devinfo command "devinfo;infos about WeeChat;[-extra] [-match];-extra: displays extra informations like in how many day the next stable will be released${\n}-match: show if you are up-to-date${\n}${\n}This command retrieve infos about current and next stable version.${\n}${\n}Exemples:${\n}  Verbose output:${\n}    /${tg_trigger_name} -extra -match;-extra|-match|%*"
/trigger set devinfo conditions "${tg_argv_eol1} =~ ^(-(extra|match) +)*(-(extra|match))?$"
/trigger set devinfo regex "/.*/${tg_argv_eol1}/my_flags /(^| )-/,/my_flags / +//my_flags /.+/${re:0},/my_flags" 
/trigger set devinfo command "/exec -norc -timeout 5 -hsignal devinfo${my_flags} url:https://weechat.org/dev/info/all/"

/trigger addreplace utils_date_calc_days info date_calc_days
/trigger set utils_date_calc_days conditions "${tg_arguments} =~ ^[0-9]{4}-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])$ && ${info:python_version} !="
/trigger set utils_date_calc_days regex "/.*/${info:python_eval,from datetime import datetime; date1 = datetime.today(); date2 = datetime.strptime('${tg_arguments}', '%Y-%m-%d'); delta = date1 - date2; print(abs(delta.days))}/tg_info"

/trigger addreplace utils_date_preferred info date_preferred
/trigger set utils_date_preferred conditions "${tg_arguments} =~ ^[0-9]{4}-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])$ && ${info:python_version} !="
/trigger set utils_date_preferred regex "/.*/${info:python_eval,from datetime import datetime; print(datetime.strptime('${tg_arguments}', '%Y-%m-%d').strftime('%x'))}/tg_info"

/trigger addreplace devinfo_hsignal hsignal devinfo*
/trigger set devinfo_hsignal conditions "${err} == && ${info:python_version} !="
/trigger set devinfo_hsignal regex "/.*/${tg_signal}/my_flags /^devinfo//my_flags /(?n)^stable:(.*)/${re:0}${if:${my_flags}=~,match,&&${info:version}!~-(dev|rc[0-9]+)? ${if:${re:1}==${info:version}?${color:121}(as mine!):${color:163}(mine is ${info:version})}}/out /(?n)^devel:(.*)/${re:0}${if:${my_flags}=~,match,&&${info:version}=~-(dev|rc[0-9]+)? ${if:${re:1}==${info:version}?${color:121}(as mine!):${color:163}(mine is ${info:version})}}/out /.*/${info:version_git}/my_git /^[^g]+g(.*)/${re:1}/my_git /(?n)^git:(.*)/${re:0}${if:${my_flags}=~,match,&&${info:version}=~-(dev|rc[0-9]+)? ${if:${re:1}=~^${my_git}?${color:121}(as mine!):${color:163}(mine is ${info:version_git})}}/out /(?n)^(stable_date:)(.*)/${re:1}${info:date_preferred,${re:2}}${if:${my_flags}=~,extra,? (since ${info:date_calc_days,${re:2}} days)}/out /(?n)^(next_stable_date:)(.*)/${re:1}${info:date_preferred,${re:2}}${if:${my_flags}=~,extra,? (${info:date_calc_days,${re:2}} days left)}/out /_/ /out /(?n)^([^:]+:)(.*)/${color:31}${re:1} ${color:default}${re:2}/out /\n/\x5cn/out"
/trigger set devinfo_hsignal command "/print -current -escape ${out}"

The devinfo trigger create the devinfo command which is used to retrieve info from https://weechat.org/dev/info/all/ and tell you if you're up-to-date (if you use the -match flag) and in how many days the next stable will be released (if you use the -extra flag)

translate with translate-shell

WeeChat Screenshot

/trigger del translate_target_lang

/buffer_autoset add exec.exec.translated_dict short_name dictionary
/set plugins.var.translate_lang fr
/buffer_autoset add irc.*.*fr localvar_set_translate_lang en

/trigger addreplace translate modifier weechat_print
/trigger set translate conditions "${tg_tags} =~ ,exec_cmd_translated_(text|lang),"
/trigger set translate regex "/.*/${color:*_31}${if:${tg_tags}=~,exec_cmd_translated_text,?Translation:Language}${color:reset}\t${tg_message_nocolor}/"

/trigger addreplace translate_hsignal hsignal translate
/trigger set translate_hsignal regex "/.*/${info:spell_dict,${_buffer}}/my_main_spell_dict /,.*//my_main_spell_dict /.*/${env:LANG}/my_env_lang /_.*//my_env_lang /.*/${_buffer_localvar_translate_lang},${if:${_buffer_localvar_type}=~^(channel|private)$?${buffer[${if:${_buffer_plugin}==irc?${info:irc_buffer,${_buffer_localvar_server}}:${info:slack_matrix_server_search,${_buffer}}}].local_variables.translate_lang}},${plugins.var.translate_lang},${my_main_spell_dict},${my_env_lang}/my_lang /.*/${my_lang}/my_debug /^,+//my_lang /([^,]+).*/${re:1}/my_lang /'/'\''/my_lang /.*/${_chat_line_message}/my_chat_line_message /'/'\''/my_chat_line_message /.*/${_chat_word}/my_chat_word /'/'\''/my_chat_word /.*/${if:${_key}==t?translated_text trans -brief -target '${my_lang}' -no-auto '${my_chat_line_message}':${if:${_key}==l?translated_lang trans -brief -no-auto -id '${my_chat_line_message}':translated_dict trans -dictionary -no-auto '${my_chat_word}'}}/my_cmd_suffix"
/trigger set translate_hsignal command "/command -buffer ${_buffer_full_name} * /exec -norc -name ${my_cmd_suffix}"

/key bindctxt cursor @chat:t /window ${_window_number};hsignal:translate;/cursor stop
/key bindctxt cursor @chat:l /window ${_window_number};hsignal:translate;/cursor stop
/key bindctxt cursor @chat:d /window ${_window_number};hsignal:translate;/cursor stop

This let you translate text with the translate-shell program (package has the same name, at least for Debian). If you want to translate something someone said, press the middle mouse button on the message then press 't'. If you want to know the language of the text, press 'l' instead. Finally, you can press 'd' this will open a buffer and call translate-shell in dictionary mode. For the key 't', the target language is choosed like this: if there is a translate_lang localvar for the buffer, use the langage specified by this localvar. If not, check if the buffer is a channel or private and if so, check if there is a translate_lang localvar for the corresponding server buffer. If not, check if the option plugins.var.translate_lang exist. Otherwhise, check if there is a main spell dict set and if not use the LANG env. So, 1) buffer localvar 2) server buffer localvar 3) option 4) main spell dict 5) LANG environment variable

Nick Validation

WeeChat Screenshot

/trigger addreplace modifier_is_nick_valid modifier input_text_display 
/trigger set modifier_is_nick_valid conditions "${tg_string_nocolor} =~ ^/nick . && ${buffer.plugin.name} == irc"
/trigger set modifier_is_nick_valid regex "===.*===${tg_string_nocolor}===my_nick ===^/nick (.+)===${re:1}===my_nick ===^-all (.+)===${re:1}===my_nick ===.*===${if:${tg_string_nocolor}=~^/nick -all[ ]?${info:python_eval,infolist = weechat.infolist_get('irc_server', '', '')\nwhile weechat.infolist_next(infolist):\n if weechat.infolist_integer(infolist, 'is_connected'): print(weechat.infolist_string(infolist, 'name') + ' ')\nweechat.infolist_free(infolist)}:${server}} ===my_servers ===[^ ]+===${re:0} ${info:irc_server_isupport_value,${re:0},NICKLEN} ${info:irc_server_isupport_value,${re:0},CASEMAPPING} ${if:${info:irc_server_isupport_value,${re:0},UTF8MAPPING}!=?${info:irc_server_isupport_value,${re:0},UTF8MAPPING}:no}===my_servers ===([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)===${re:0} ${if:${info:irc_is_nick,${re:1},${my_nick}}!=?valid:invalid}===my_servers ===([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)===\n${if:${re:5}==valid?${color:016,046}:${color:016,163}}${re:1} ${color:reverse} NICKLEN = ${calc:${re:2} - ${length:${my_nick}}}/${re:2}  CASEMAPPING = ${re:3}  UTF8MAPPING = ${re:4}${color:016,default}===my_servers ===.*===${re:0} ${my_servers}===tg_string"

This trigger will give you hint about max nickname length and available character in nickname and will also tell you if the nick is valid or not. Also note that weechat has limited support for the rfc8265. For example, on an ergo server with utf8 nickname enabled, weechat correctly report the nickname é as valid but incorrectly report │ as valid.

WeeChat Animated logo

≥ WeeChat 3.3 for ${split:...}

WeeChat Screenshot

/trigger addoff weechat_logo_random_colors timer 500;0;0
/trigger set weechat_logo_random_colors regex "/.*/${plugins.var.logo_colors}/my_colors /^$/24,31,121,163,229,white/my_colors ===.*===___       __         ______________        _____===my_first ===.*===__ |     / /___________  ____/__  /_______ __  /_===my_second ===.*===__ | /| / /_  _ \  _ \  /    __  __ \  __ `/  __/===my_third ===.*===__ |/ |/ / /  __/  __/ /___  _  / / / /_/ // /_===my_forth ===.*===____/|__/  \___/\___/\____/  /_/ /_/\__,_/ \__/===my_fifth /[^ ]/${color:*${split:random,,collapse_seps+strip_left+strip_right,${my_colors}}}${re:0}${color:reset}/my_first /[^ ]/${color:*${split:random,,collapse_seps+strip_left+strip_right,${my_colors}}}${re:0}${color:reset}/my_second /[^ ]/${color:*${split:random,,collapse_seps+strip_left+strip_right,${my_colors}}}${re:0}${color:reset}/my_third /[^ ]/${color:*${split:random,,collapse_seps+strip_left+strip_right,${my_colors}}}${re:0}${color:reset}/my_forth /[^ ]/${color:*${split:random,,collapse_seps+strip_left+strip_right,${my_colors}}}${re:0}${color:reset}/my_fifth"
/trigger set weechat_logo_random_colors command "/print -free -newbuffer logo -y 0 ${my_first};/print -free -newbuffer logo -y 1 ${my_second};/print -free -newbuffer logo -y 2 ${my_third};/print -free -newbuffer logo -y 3 ${my_forth};/print -free -newbuffer logo -y 4 ${my_fifth}"

/trigger addreplace logo command "logo;WeeChat Animated Logo;start|stop|toggle|faster|slower || timer <time> [<align> [<number>]] || speed <speed> || color [\"<range>...\" [\"<name>...\"]]; start: start the timer${\n}  stop: stop the timer${\n}toggle: toggle the timer${\n}faster: increase the speed of the timer${\n}slower: decrease the speed of the timer${\n} timer: use a custom ms${\n} speed: use a preset${\n} color: specify the colors${\n}  time: number of ms${\n} align: alignment on second${\n}number: max number of calls${\n} speed: one of the following values: ultra, fast, normal, slow${\n} range: a range, eg: 3-35${\n}  name: name of a color${\n}${\n}Let's play with the WeeChat Animated ASCII logo!${\n}${\n}Exemples:${\n}  Start the timer !!${\n}    /logo start${\n}  Change the colors${\n}    /logo color \"\" \"24 31 121 163 229 white\";start|stop|toggle|faster|slower || timer 5000|4000|3000|2000|1000 || speed ultra|fast|normal|slow || color 0-255"
/trigger set logo conditions "${tg_argv_eol1} =~ ^(start|stop|toggle|faster|slower)$ || ${tg_argv_eol1} =~ ^timer +[0-9]+( +[0-9]+)?( +[0-9]+)?$ || ${tg_argv_eol1} =~ ^speed +(ultra|fast|normal|slow)$ || (${tg_shell_argv1} == color && ${tg_shell_argv2} =~ ^ *(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-6])-([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-6])( +|$))*$ && ${tg_shell_argc} <= 4)"
/trigger set logo regex "/.*/${tg_argv1}/my_action /start/enable/my_action /stop/disable/my_action /.*/${trigger.trigger.weechat_logo_random_colors.arguments}/my_hook_args /.*/${split:1,;,,${my_hook_args}}/my_current_ms /.*/${if:${my_action}==timer?${tg_argv3}:${split:2,;,,${my_hook_args}}}/my_align_sec /.*/${if:${my_action}==timer?${tg_argv4}:${split:3,;,,${my_hook_args}}}/my_num_call /.*/${if:${my_action}==faster?${if:${my_current_ms}<=50?${my_current_ms}:${calc:${my_current_ms}-50}}:${if:${my_action}==slower?${calc:${my_current_ms}+50}:${if:${my_action}=~^(speed|timer)$?${tg_argv2}}}}/my_speed /ultra/5/my_speed /fast/50/my_speed /normal/500/my_speed /slow/1000/my_speed /.*/${if:${my_action}==color?${tg_shell_argv2}}/my_colors /([0-9]+)-([0-9]+)/${info:python_eval,print(' '.join(map(str, list(range(${re:1},${re:2})))))}/my_colors /$/${if:${my_action}==color? ${tg_shell_argv3}}/my_colors / +/,/my_colors  /^,|,$//my_colors ===.*===/mute ${if:${my_action}=~(enable|disable|toggle)?/trigger ${my_action} weechat_logo_random_colors:${if:${my_action}==color?/set plugins.var.logo_colors '${my_colors}':/trigger set weechat_logo_random_colors arguments ${my_speed};${my_align_sec};${my_num_call}}}===my_cmds_to_run"
/trigger set logo command "/command -buffer core.weechat * /eval ${my_cmds_to_run}"

/key bindctxt mouse @chat(core.logo):button1 /logo toggle
/key bindctxt mouse @chat(core.logo):button1-gesture-left* /logo slower
/key bindctxt mouse @chat(core.logo):button1-gesture-right* /logo faster

/buffer_autoset add core.logo title Animated WeeChat Logo - Click on the logo to toggle the animation - Use gesture to increase and decrease the speed

/alias add logo_xmas /logo color "" "34 46 40 124 160 196 white"
/alias add logo_config /logo color "" "24 31 121 163 229 white"

useless thing but nonetheless beautiful

Upgrade Scripts

/trigger addreplace day_changed_upgrade_scripts signal day_changed
/trigger set day_changed_upgrade_scripts command "/script update;/wait 10s /script upgrade"

This trigger will update the local script cache and then upgrade all the installed scripts at midnight.

No notify for duck hunt commands

/trigger addreplace no_notify_duck_command line *;irc.*;irc_privmsg
/trigger set no_notify_duck_command conditions "${tg_message_nocolor} =~ ^[!,.](bef|bang|reload|shop|duckstats|friends|killers)(\s|$) && ${buffer.local_variables.type} == channel"
/trigger set no_notify_duck_command regex "/.*/-1/notify_level"

Disable notify for duck hunt commands like bef, bang, reload and so on. This way I know there is nothing worth reading on a channel so I don't switch to that buffer.

holiday

/trigger addreplace utils_holiday info holiday
/trigger set utils_holiday conditions "${tg_arguments} =~ ^(0[1-9]|[1-2][0-9]|3[0-1])-(0[1-9]|1[0-2])$"
/trigger set utils_holiday regex "/.*/${tg_arguments}/ /01-01/HAPPY NEW YEAR!/ /25-12/MERRY CHRISTMAS!/ /[0-9][0-9]-[0-9][0-9]//"

this info is useful for the weechat.look.day_change_message_1_date and _2dates. See these options at the bottom of my configuration.

Highlight

/set weechat.look.highlight *pascalpoitras*

Keys

/key bindctxt cursor @item(buffer_nicklist):v /window ${_window_number};/voice ${nick}
/key bindctxt cursor @item(buffer_nicklist):o /window ${_window_number};/op ${nick}
/key bindctxt cursor @item(buffer_nicklist):V /window ${_window_number};/devoice ${nick}
/key bindctxt cursor @item(buffer_nicklist):O /window ${_window_number};/deop ${nick}
/key bindctxt cursor @chat:s /window ${_window_number};/slap ${_chat_line_nick};/cursor stop
/key bindctxt cursor @item(buffer_nicklist):s /window ${_window_number};/slap ${nick};/cursor stop

/key bindctxt cursor @chat:a /command -buffer ${buffer.full_name} core /input insert ${_chat_bol}\x20;/cursor stop
/key bindctxt cursor @chat:e /command -buffer ${buffer.full_name} core /input insert ${_chat_eol}\x20;/cursor stop
/key bindctxt cursor @chat:w /command -buffer ${buffer.full_name} core /input insert ${_chat_word}\x20;/cursor stop

Others Keyboard shortcuts

/key bind meta-meta2-A /bar scroll nicklist * -100%
/key bind meta-meta2-B /bar scroll nicklist * +100%
/key bind meta2-A /input history_global_previous
/key bind meta2-B /input history_global_next

Alias

/alias add ame allchan -current /me
/alias add amsg allchan -current /msg *
/alias add cq /allpv /buffer close
/alias add znc /quote znc
/alias add irc_stats /set plugins.var.total_irc_servers 0;/set plugins.var.total_irc_channels 0;/set plugins.var.total_irc_privates 0;/allserv /eval /set plugins.var.total_irc_servers ${calc:${plugins.var.total_irc_servers}+1};/allchan /eval /set plugins.var.total_irc_channels ${calc:${plugins.var.total_irc_channels}+1};/allpv /eval /set plugins.var.total_irc_privates ${calc:${plugins.var.total_irc_privates}+1};/eval I am currently on ${plugins.var.total_irc_servers} server${if:${plugins.var.total_irc_servers}>1?s}, ${plugins.var.total_irc_channels} channel${if:${plugins.var.total_irc_channels}>1?s} and I have ${plugins.var.total_irc_privates} quer${if:${plugins.var.total_irc_privates}>1?ies:y}.;/unset -mask plugins.var.total_irc_*
/alias addcompletion -m close /eval ${if:-m==$*?/allpv }/buffer close
/alias addcompletion %(irc_channel)|%(nick)|%* slap /me slaps $* around a bit with a large trout
/alias addcompletion %(irc_channel)|%(nick)|%* fu /say (╹◡╹)凸 $*
/alias addcompletion %(weechat_commands) multicomm /alias add temp $*;/temp

The multicomm alias is an alternative to /eval -s, but more "secure". If you use eval -s for this purpose (execute more than one command) but you forget that thing like secure variables will be evaluate this can be very bad.

Filters

/set irc.look.smart_filter on
/filter add irc_smart * irc_smart_filter *

/filter addreplace bitlbee_lots_of_hashtags irc.bitlbee.#* * (#[^ ]+.*){4}
/filter addreplace bitlbee_no_rt irc.bitlbee.#* * ^\[[^]]+\] RT @[^: ]+:
/filter addreplace bitlbee_no_reply irc.bitlbee.#* * ^\[[^]]+\] @[^ ]+
/filter addreplace bitlbee_no_hashtags_only irc.bitlbee.#* * ^\[[^]]+\] (#[^ ]+( +|$))+$

The last four filters are useful in bitlbee twitter channels, this hide tweet with four or more hashtags, retweets, replies and tweets containing only hashtags

Custom join color

/set weechat.color.chat_prefix_join 121
/set weechat.color.chat_host 31
/set irc.color.message_join 121

The weechat.color.chat_host option will also set this color for part and quit. To have a different color, for example, a host in red for parts and quits and green for joins, see this.

Custom part and quit

/set weechat.color.chat_prefix_quit 131
/set irc.color.message_quit 131

exec options

/set exec.command.shell bash

The remaining IRC options

/set irc.server_default.away_check 5
/set irc.server_default.away_check_max_nicks 25
/set irc.color.nick_prefixes "q:lightred;a:lightcyan;o:121;h:lightmagenta;v:229;*:lightblue"
/set irc.network.ban_mask_default "*!*@$host"
/set irc.look.buffer_switch_autojoin off
/set irc.look.buffer_switch_join off
/set irc.look.color_nicks_in_nicklist on
/set irc.look.part_closes_buffer on
/set irc.color.mirc_remap "1,-1:16;14,-1:240"

The remaining Weechat options

/set weechat.look.bar_more_down ""
/set weechat.look.bar_more_up ""
/set weechat.look.bar_more_left "…"
/set weechat.look.bar_more_right "…"
/set weechat.look.buffer_notify_default message
/set weechat.look.buffer_time_format "${color:245}%H${color:253}%M"
/set weechat.look.color_inactive_message off
/set weechat.look.color_inactive_prefix off
/set weechat.look.color_inactive_prefix_buffer off
/set weechat.look.color_inactive_window off
/set weechat.look.day_change_message_1date "▬▬▶ ${if:${info:holiday,%d-%m}?${info:holiday,%d-%m}:%a, %d %b %Y} ◀▬▬"
/set weechat.look.day_change_message_2dates "▬▬▶ ${if:${info:holiday,%%d-%%m}?${info:holiday,%%d-%%m}:%%a, %%d %%b %%Y} (%a, %d %b %Y) ◀▬▬"
/set weechat.look.hotlist_add_conditions "${away} || ${buffer.num_displayed} == 0"
/set weechat.look.item_buffer_filter "•"
/set weechat.look.prefix_align_min 0
/set weechat.look.prefix_align_max 10
/set weechat.look.prefix_join "▬▬▶"
/set weechat.look.prefix_quit "◀▬▬"
/set weechat.look.prefix_suffix "│"
/set weechat.look.read_marker_string "─"
/set weechat.look.separator_horizontal ""


/set weechat.color.bar_more 229
/set weechat.color.chat_highlight lightred
/set weechat.color.chat_highlight_bg default
/set weechat.color.chat_nick_colors "cyan,magenta,green,brown,lightblue,lightcyan,lightmagenta,lightgreen,blue"
/set weechat.color.chat_prefix_more 31
/set weechat.color.chat_prefix_suffix 31
/set weechat.color.chat_read_marker 31
/set weechat.color.chat_time 239
/set weechat.color.chat_delimiters 31
/set weechat.color.separator 31
/set weechat.color.status_data_highlight 163
/set weechat.color.status_data_msg 229
/set weechat.color.status_data_private 121
/set weechat.color.status_more 229
/set weechat.color.status_name 121
/set weechat.color.status_name_ssl 121

⚠️ BE SURE TO USE THE DEVEL VERSION OF WEECHAT ⚠️

The following command will let you run all the commands of my configuration (not really recommended, you should take only what you want and understand)

First, type the following

/secure passphrase <pass>
/secure set bitlbeepass <pass>
/secure set liberachatpass <pass>
/secure set relaypass <pass>
/secure set defaultnicks <nicks-csv>
/secure set defaultsasluser <username>
/set plugins.var.news_buffer_full_name <full name of the news buffer> (only needed if you access the ##news channel via matrix)
/set script.scripts.download_enabled on
/script install autojoin.py buffer_autoset.py autosort.py

Once scripts are installed

⚠️ DO NOT RUN THIS BEFORE ALL THE SCRIPTS ABOVE ARE INSTALLED ⚠️

/exec -sh -oc curl -sfS https://gist.githubusercontent.com/pascalpoitras/8406501/raw/myweechat.md | sed -E 's/^\s+//;/^(\/secure|\/script)/d;/^\//!d'
@gngrn1nja

This comment has been minimized.

Copy link

@gngrn1nja gngrn1nja commented Jan 9, 2021

Hey,
Whenever I middle click a news item "/key bindctxt cursor @chat(core.newsmon):i hsignal:news_click;/cursor stop" is displayed in the input area. How can I make this behave like you intended it to?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jan 9, 2021

@gngrn1nja

I am unable to reproduce, can you try to rerun commands in the news section (except for filter)? and are you sure you middle click in the core.newsmon buffer and not irc.freenode.##news ?

@nsturtz

This comment has been minimized.

Copy link

@nsturtz nsturtz commented Jan 9, 2021

I forgot to come back and thank you for your help @pascalpoitrs!

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 12, 2021

Could someone help me please? Which steps I need if I only want:

  • bufferlist expand/collapse thingy with the triangles
  • tree view
  • message count in bufferlist
    And I would also like to disable the hotlist above the text input if I can get the message count in the bufferlist. I tried to set buflist.format.hotlist to " " but that didn't remove it.
@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland

hi, you will need to run everything in the bar buflist and control buffers section and remove hotlist items from the option weechat.bar.status.items

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 12, 2021

Thanks for the help. I also have another question, is it possible to just add text in weechat.bar.status.items? I would like to add users: before buffer_nicklist_count. I tried escaping and using single/double quotes.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland you will have to use the text_item.py script

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 12, 2021

I copied the lines and it worked except for this one: /set buflist.look.use_items 2: Error: option "buflist.look.use_items" not found
collapsing servers works now but expanding does not.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland this option is new in version 3.1

you must be on 3.1 otherwise you will run into issue

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 12, 2021

Oh, I had 3.1 but I was still running 3.0. I reentered the commands, /set buflist.look.use_items 2 worked this time, but expanding still doesn't work.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland can you show me the output of /script list

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 12, 2021

ia keepnick.py 1.6 (keep your nick and recover it in case it's occupied)
I only have keepnick. Do I need buffer_autoset.py?

@nsturtz

This comment has been minimized.

Copy link

@nsturtz nsturtz commented Mar 12, 2021

ia keepnick.py 1.6 (keep your nick and recover it in case it's occupied)
I thought that was a ZNC plugin? Is it not?

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 12, 2021

weechat also has a keepnick plugin.

@nsturtz

This comment has been minimized.

Copy link

@nsturtz nsturtz commented Mar 12, 2021

Oh ok thank you.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland yes you need buffer_autoset.py for the arrow to work fully

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 12, 2021

Okay, I installed buffer_autoset.py and it works great. Thanks for all the help.

@pascalpoitras: I have a suggestion btw: The last channel/private in a server could have └─ instead of ├─ in the tree view :D I have no clue if it's possible (but I guess you could tell this from my comments).

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland yes it is possible i will look at this in a few day i am busy right now, expect an answer next week !

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland this is a great idea by the way I will probably add an option for that

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 12, 2021

@pcroland I misread you I thougt you meant the last buffer not the last buffer of all servers. While it is possible, this is hard without using the scripting API because we first need to detect the type of the next buffer but the next buffer may be hidden or folded, so I would recommend to you to write a script for that

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 13, 2021

@pcroland I reopened an old issue and if FlashCode accept to implement that, I would add that feature

add buflist info

@catman370

This comment has been minimized.

Copy link

@catman370 catman370 commented Mar 14, 2021

weechat1

Pascal.. after a weechat upgrade this happened. I seemed to have lost the tabs, don't see newsmon, and the conky window took over the screen. Help! lol

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 14, 2021

@catman370

yeah a bug has been fixed in weechat 3.1 for the layout so you need to run what's under the layout section again:

/window merge all
/eval /window splith ${calc:9 / ${window[gui_current_window].win_height} * 100 // 1}
/buffer highmon
/window 1
/layout store main-control windows
/window 2
/eval /window splitv ${if:${info:version_number}>=50397184?15:85}
/buffer exec.conky
/window 1
/layout store main-control-conky windows

and for the tabs this is because you need to change the default value of a new option introduced in weechat 3.1

/set buflist.look.use_items 2

@catman370

This comment has been minimized.

Copy link

@catman370 catman370 commented Mar 14, 2021

thank you so much. all fixed except the tabs for some reason. confirmed buflist.look.use_items was set to 2.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 14, 2021

@catman370

oh yeah, I changed the tabs to use buflist2 instead of buflist3 (so i can set use_items to 2 instead of 3 so it's faster)

you can either run everything below the buflist section (to replace buflist3 by buflist2) OR set the use_items to 3 (and keep the buflist as it was)

@catman370

This comment has been minimized.

Copy link

@catman370 catman370 commented Mar 14, 2021

all good. thanks again.

@Ryan659

This comment has been minimized.

Copy link

@Ryan659 Ryan659 commented Mar 31, 2021

I installed this (but didn't install the conky or news) and it works great! The only problem, when I open weechat it mixes up which channels should be under which servers and just puts all the channels below the servers...

Mess

Is this a problem that I've done? Version is 3.1

@pcroland

This comment has been minimized.

Copy link

@pcroland pcroland commented Mar 31, 2021

/set irc.look.new_channel_position near_server
/set irc.look.new_pv_position near_server
@Ryan659

This comment has been minimized.

Copy link

@Ryan659 Ryan659 commented Mar 31, 2021

That works great, thanks! I was also wondering: is it possible to put the output of a specific user from a channel into its own buffer/tab on the top window (alongside chanmon/highmon etc)?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Mar 31, 2021

@Ryan659

if you want, for example, to redirect my message (nick r3m) from #weechat on freenode

/trigger add redirect_user print irc.freenode.#weechat;nick_r3m "" "" "/print -newbuffer r3m -tags ${tg_tags} ${tg_prefix}\t${tg_message}"

the buffer 'r3m' will be created after the first message coming from the nick r3m, you can create the buffer right now if you want

/buffer add r3m

then middle-click on the r3m buffer in the buflist and press 'c'. Now the buffer should be with the other 'tabs'

Next time you'll start weechat, you will have to wait until a message is coming from r3m, you can either

/buffer add r3m

or you can add the creation of this buffer on start

/eval /set weechat.startup.command_after_plugins ${weechat.startup.command_after_plugins}${if:${weechat.startup.command_after_plugins}!=?;}/buffer add r3m

don't forget to adjust the server and the nick in all this commands

@Ryan659

This comment has been minimized.

Copy link

@Ryan659 Ryan659 commented Mar 31, 2021

That's great, thanks again!

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Apr 5, 2021

to everyone: there was a bug in ${if:...} that was fixed today in weechat, so I fixed newsmon, if the url is shown in message even if you disabled it, this is due to that, run the following to fix newsmon

/trigger set newsmon command "/print -newbuffer ${tg_trigger_name} -tags ${tg_tags} \t${my_list}${my_title}${if:${eval_cond:${plugins.var.newsmon.general.keep_url}}!=? ${my_url}}${if:${eval_cond:${plugins.var.newsmon.general.keep_date}}!=? ${my_date}}"

I have not found any other code posing problem for the moment, if I found any I'll report in comments

@janemba

This comment has been minimized.

Copy link

@janemba janemba commented May 3, 2021

Hello,

How can I change the color of the channel list numbers ?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented May 3, 2021

@janemba

Hi,

replace black and 239 by the color you want in buflist.format.number (currently black is for servers buffers and 239 for others buffers)

for example replace black by red and 239 by 31

/set buflist.format.number "${if:${plugins.var.buflist_subsection_buffer_number}!=?${if:${current_buffer}?${color:*white}${hide:>,${number}} :${if:${type}==server?${color:red}:${color:31}}${number}${if:${number_displayed}?.: }}}"

@janemba

This comment has been minimized.

Copy link

@janemba janemba commented May 3, 2021

@pascalpoitras

Perfect !! Thx.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented May 19, 2021

newsmon now take the news from Libera.Chat not freenode, so you will have to type the following

/eval /buffer_autoset add ${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.chat.##news} localvar_set_no_chanmon_like 1
/eval /buffer_autoset add ${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.chat.##news} hidden 1
/eval /filter addreplace news_interest core.newsmon,${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.libera.chat.##news} irc_privmsg+nick_newsly*,matrix_message+nick_newsly* !^(\s|\[)(Reddit [-] /r/netsec|Wired|EFF Updates|erry's blog|techdirt|TorrentFreak|Science Daily|Hacker News|CNET|phoronix|Ars Technica|The Intercept|france24|Radio-Canada Nouvelles|Canoe|Huffington Post [-] Weird News|Journal du hacker|Futura Sciences)( \-| | |\])
/eval /trigger addreplace newsmon print "${if:${plugins.var.news_buffer_full_name}!=?${plugins.var.news_buffer_full_name}:irc.freenode.##news};irc_privmsg,matrix_message,debug_newsmon"
/trigger set newsmon conditions "${info:version_number} >= 50462720"
/trigger set newsmon regex "/.*/${tg_message_nocolor}/my_site_and_sections /^\[([^]]+)\].*/${re:1}/my_site_and_sections / - /${if:${plugins.var.newsmon.look.powerline}!=?  : - }/my_site_and_sections /.*/${my_site_and_sections}/my_site /.*/${if:${my_site_and_sections}=~[ ][-][ ]?${my_site_and_sections}}/my_site_sections / [-] .*//my_site / [-] (.*)/----- ${re:1}/my_site_sections /.*----- //my_site_sections /.*/${tg_message_nocolor}/my_title /^\[[^]]+\] (.*)/${re:1}/my_title /.*/${my_title}/my_date /.* ([0-9]{4}-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])/${re:1}/my_date /(.*) [0-9]{4}-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/${re:1}/my_title /.*/${my_title}/my_url ==.* (https?://[^ ]+)==${re:1}==my_url ==(.*) https?://[^ ]+==${re:1}==my_title /.*/${my_url}/my_url_encode /.*/${base_encode:64,${my_url_encode}}/my_url_encode /\+/#/my_url_encode /$/url_${my_url_encode}/tg_tags /.*/${tg_date}/my_date_only /(.*) .*/${re:1}/my_date_only /.*/${tg_date}/my_time_only /.* (.*)/${re:1}/my_time_only /.*/${channel}/my_channel_no_prefix /^.(.)(.*)/${if:${re:1}==#&&${info:irc_server_isupport_value,${server},NETWORK}==freenode?:${re:1}}${re:2}/my_channel_no_prefix /.*/0/my_default_length /.*/white/my_default_fg /.*/31/my_default_bg /.*/24/my_default_separator /.*/default/my_end.bg /.*/${plugins.var.${tg_trigger_name}.list}/my_list /[^,]+/${if:${re:0}=~^[[:alnum:]_]+$?${re:0}}/my_list /[^,]+/plugins.var.${tg_trigger_name}.section.${re:0}/my_list /[^,]+/${if:${length:${eval:${${re:0}.content}}}!=?${re:0}}/my_list /[^,]+/${re:0},${re:0}/my_list /[^,]+(.*)/${re:1}/my_list /.*[^,].*/${re:0},my_end/my_list /,+/,/my_list /^,|,$//my_list /([^,]+),([^,]+)/${if:${length:${eval:${${re:1}.fg}}}!=?${re:1}.fg:my_default_fg},${if:${length:${eval:${${re:1}.bg}}}!=?${re:1}.bg:my_default_bg},${if:${length:${eval:${${re:1}.separator}}}!=?${re:1}.separator:my_default_separator},${if:${length:${eval:${${re:1}.length}}}!=?${re:1}.length:my_default_length},${re:1}.content,${if:${length:${eval:${${re:2}.bg}}}!=?${re:2}.bg:my_default_bg}/my_list /([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)(,|$)/${if:${plugins.var.${tg_trigger_name}.look.powerline}!=?${color:${eval:${${re:1}},${${re:2}}}} ${if:${eval:${${re:4}}}=~^[0-9]+$&&${eval:${${re:4}}}!=?${if:${lengthscr:${eval:${${re:5}}}}>=${eval:${${re:4}}}?${cutscr:+${eval:${${re:4}}},…,${eval:${${re:5}}}}:${eval:${${re:5}}}${repeat:${calc:${eval:${${re:4}}}-${lengthscr:${eval:${${re:5}}}}}, }}:${eval:${${re:5}}}}${color:${eval:${${re:1}},${${re:2}}}} ${if:${color:${eval:${${re:2}}}}==${color:${eval:${${re:6}}}}?${color:${eval:${${re:3}}}}:${color:${eval:${${re:2}},${${re:6}}}}}${color:reset}:${color:${eval:${${re:3}},${${re:2}}}}[${color:${eval:${${re:1}}}}${if:${eval:${${re:4}}}=~^[0-9]+$&&${eval:${${re:4}}}!=?${if:${lengthscr:${eval:${${re:5}}}}>=${eval:${${re:4}}}?${cutscr:+${eval:${${re:4}}},…,${eval:${${re:5}}}}:${eval:${${re:5}}}${repeat:${calc:${eval:${${re:4}}}-${lengthscr:${eval:${${re:5}}}}}, }}:${eval:${${re:5}}}}${color:${eval:${${re:3}},${${re:2}}}}]${color:reset} }/my_list /.+/${re:0} /my_list"
/trigger set newsmon command "/print -newbuffer ${tg_trigger_name} -tags ${tg_tags} \t${my_list}${my_title}${if:${plugins.var.newsmon.look.keep_url}!=? ${my_url}}${if:${plugins.var.newsmon.look.keep_date}!=? ${my_date}}"
@Barbarossa93

This comment has been minimized.

Copy link

@Barbarossa93 Barbarossa93 commented May 31, 2021

Sorry for the noob question, but how can I highlight a server name to be red in the buflist (foreground/text color I mean)?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented May 31, 2021

@Barbarossa93

Hi,

I suppose you are using my buflist ? if so you can change the color in the option buflist.format.name, replace white by the desired color, so if you want red type the following

/set buflist.format.name "${if:${plugins.var.buflist_subsection_buffer_name}!=?${if:${type}==server?${color:red}${if:${plugins.var.buflist_look_real_net_name}!=&&${info:irc_server_isupport_value,${name},NETWORK}?${info:irc_server_isupport_value,${name},NETWORK}:${name}}:${eval:${color_hotlist}}${name}}}"

@Barbarossa93

This comment has been minimized.

Copy link

@Barbarossa93 Barbarossa93 commented May 31, 2021

@Barbarossa93

This comment has been minimized.

Copy link

@Barbarossa93 Barbarossa93 commented May 31, 2021

So this works more towards what I want:

/set buflist.format.name ${if:${type}==server${color:red} ${if:${plugins.var.buflist_look_real_net_name}!=&&${info:irc_server_isupport_value,${name},NETWORK}?${info:irc_server_isupport_value,${name},NETWORK}: ${name}}:${eval:${color_hotlist}}${name}}"

but it creates extra spaces next to channel names when I only want one space between the index and channel name. I had to add a space next to ${name} (the one just before the eval to create a single space for server names

EDIT: Ah, I had to run /set buflist.format.indent " " and that did it for me. Thanks @pascalpoitras!

@rhymeswithmogul

This comment has been minimized.

Copy link

@rhymeswithmogul rhymeswithmogul commented Jun 4, 2021

The duck hunt commands were worth the read. I know I'm no fun, so thank you for helping hide the most annoying part of IRC.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jun 4, 2021

very important trigger indeed! 😆 thanks @rhymeswithmogul 😄

@catman370

This comment has been minimized.

Copy link

@catman370 catman370 commented Jun 4, 2021

pascal.. I used your suggestion above to MatijaTerzic to show buddylist output below the buflist with a text separator. is there a way to permanently hide the original buddy list bar so I don't have to keep typing the /bar hide buddylist command? in other words, to set the weechat.bar.buddylist.hidden permanently on?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jun 4, 2021

@catman370

I think you have to
/set plugins.var.perl.buddylist.hide.bar always

but not sure, let me know if it works!

@catman370

This comment has been minimized.

Copy link

@catman370 catman370 commented Jun 4, 2021

@jdsto

This comment has been minimized.

Copy link

@jdsto jdsto commented Jul 28, 2021

I'm having a problem with matrix room messages in chanmon. The server shows as "matrix" and the nickname shows fine, but the channel shows as a really long string like "atrix.matrix_org.!P1Sh2LHvYGw…"

Is there any way to solve this so it shows the proper Matrix channel name in the chan section? I set the length of the chan section to 20 for now just to show the problem, but usually I have it set to 6, so I see nothing but "matrix" and I can never figure out where the messages are coming from.

I've been trying to mess around to find a solution, but I must be missing something.

Alternatively, if this is not possible to fix, is it possible to remove matrix messages from chanmon entirely?

Example of the problem below.
matrix_000

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jul 28, 2021

@jdsto thanks for reporting this, I am not using matrix so I was not aware of this bug

I fixed the problem you just have to execute the new chanmon regex (chanmon trigger), highmon regex (highmon trigger) and newsmon regex (newsmon trigger) of the config

but please confirm that it solves your issue!

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jul 28, 2021

@jdsto ah yeah I was relying on the canonical_alias local variable of the channel buffer but it seems that it is not set for all channels, just a couple of them, try to run

/buffer localvar

on each of your matrix buffer and you will see that some of them have this variable but others doesn't

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jul 29, 2021

@jdsto I updated the regexes to use the short_name instead, it should works now, can you confirm ?

@jdsto

This comment has been minimized.

Copy link

@jdsto jdsto commented Jul 29, 2021

@pascalpoitras It works perfectly now, thanks!!

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jul 29, 2021

@jdsto which way do you use to connect to discord ? bitlbee ? can you give me the link I would like to try to fix the problem, thanks

@jdsto

This comment has been minimized.

Copy link

@jdsto jdsto commented Jul 29, 2021

@pascalpoitras Oh no it's not me using discord, but there is a discord bridge in some of the matrix rooms I'm in (#veloren-general:fachschaften.org, for example), and anyone speaking in those matrix rooms through it seems to cause chanmon to go crazy and append part of their nick (I looked it up on an actual matrix client and zesterer is "zesterer [GMT+0]") along with extra stuff to the left of the timestamps like on my screenshot.

I'm really not sure what's going on though, but it's the only conclusion I can come to after trying to figure this out.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jul 29, 2021

@jdsto thanks I'll have a look!

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jul 29, 2021

@jdsto ok it should works now, the problem is that matrix allows space in the display name and you can't pass tag with a space to /print

run one more time the same three regexes but this time also run the command of newsmon trigger (or simply rerun all four lines of newsmon trigger) and let me know if this works

@jdsto

This comment has been minimized.

Copy link

@jdsto jdsto commented Jul 29, 2021

@pascalpoitras That worked! Thanks again, now my chanmon is perfect :)

@jdsto

This comment has been minimized.

Copy link

@jdsto jdsto commented Jul 30, 2021

I have another problem with matrix: I can't seem to get highlights to show in the highlight monitor, no matter if the person says @jdsto, jdsto or jdsto:matrix.org, for example. Do you know why that is?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Jul 30, 2021

@jdsto this is normal behavior I suppose, the option irc.look.highlight_channel is set to $nick this is why irc buffers are highlighted when someone mention your nick but this option will not works with matrix unfortunately, what you can do is to set the highlight_word property of all matrix buffers to your nick

/buffer_autoset add python.matrix.matrix_org* highlight_words_add yourNickHere

I think it should works then, note that you can replace yourNickHere by more than one nick using CSV notation.

EDIT: you can just add your nick (the one without the leading at sign and no :matrix.org suffix) this will works for all three
EDIT: this works here without doing the above command, but my irc nick is the same as my matrix nick this might be why it works, so you can also try to set irc.look.highlight_channel to $nick,yourNickHere

@rpfernandezjr

This comment has been minimized.

Copy link

@rpfernandezjr rpfernandezjr commented Aug 20, 2021

hey @pascalpoitras - really like your setup, i've been trying to get it running on my end but having a couple issues.

  • The tabbing in the channel monitoring| and news monitoring window doesn't seem to render properly
  • The newsmon buffer doesn't receive any news feeds from the regex.

weechat

Any chance you can point me in the right direction?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Aug 20, 2021

@rpfernandezjr

hi, thanks :)

for the tabbing you need a font with extra powerline symbol, pick one at nerdfonts
for the newsmon buffer, my config have a filter to filter a lot of news, try disabling it with /filter disable news_interest

let me know if that fix your issues!

@rpfernandezjr

This comment has been minimized.

Copy link

@rpfernandezjr rpfernandezjr commented Aug 20, 2021

@pascalpoitras
thx, got the tabbing to render properly with the fonts. I disabled the filter, and still nothing on newsmon.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Aug 20, 2021

@rpfernandezjr

can you give me the output of the following commands

/eval -n ${trigger.trigger.newsmon.arguments}

and

/server list libera

@rpfernandezjr

This comment has been minimized.

Copy link

@rpfernandezjr rpfernandezjr commented Aug 20, 2021

sure thing,

│14:55:35   │ >> ${trigger.trigger.newsmon.arguments}
│14:55:35   │ == [newsmon;irc_privmsg,matrix_message,debug_newsmon]
│14:55:45   │ 
│14:55:45   │ Servers with "libera":
│14:55:45   │  * libera [connected], nick: axin, 3 channels, 0 pv

here's my filter too

│   [news_interest] buffer: newsmon / tags: irc_privmsg+nick_newsly*,matrix_message+nick_newsly*,matrix_text+nick_newsly* / regex: !^(\s|\[)(Reddit [-] /r/netsec|r/Ripple|r/sre|r/devops|
│ Wired|EFF Updates|r/devops|erry's blog|techdirt|TorrentFreak|Science Daily|Hacker News|CNET|phoronix|Ars Technica|The Intercept|Huffington Post [-]
│ Weird News|Journal du hacker|Futura Sciences)( \-| | |\]) (disabled)
@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Aug 20, 2021

ah it should be

irc.libera.##news;irc_privmsg,matrix_message,matrix_text,debug_newsmon

you set plugins.var.news_buffer_full_name to newsmon which is why you get this problem
do the following

/unset plugins.var.news_buffer_full_name

now rerun everything in the newsmon section of the configuration

@rpfernandezjr

This comment has been minimized.

Copy link

@rpfernandezjr rpfernandezjr commented Aug 20, 2021

@pascalpoitras that did the trick, thanks!

@arooni

This comment has been minimized.

Copy link

@arooni arooni commented Aug 24, 2021

i noticed cpu usage is very high on this... anything i can do? 3.2 weechat on ubuntu 20.04 seeing cpu loads 20-30-40% when in use. quad core intel mobile processor

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Aug 24, 2021

@arooni

as stated in the buflist section the buflist is slow for two reasons

the first reason is that the buflist is refresh each time the hotlist_changed signal is received, so each time a user join/part/quit or send a message for example the whole buflist is refresh (this is why when there is a netsplit weechat hang for a few seconds) so if you have a lots of channels the situation will be worse especially if these channels are active

the second reason is that my buflist configuration is very complex so each time the hotlist_changed signal is received, the buflist.format.* options are evaluated and those format are very complex and must be executed for each buffers, so again, if you have a lot of channels the situation will be a lot worse

A way to mitigate this a bit is to set the default notify level to message so that joins part and quit doesnt trigger the hotlist_changed signal this will help a lot but still slow

@arooni

This comment has been minimized.

Copy link

@arooni arooni commented Aug 24, 2021

thanks for the quick response @pascalpoitras!

can you tell me which notify setting you were saying?

what about disabling the hostlist_changed signal and leaving the rest? many thanks!

also how can i simply ignore when a users joins/parts/etc

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Aug 24, 2021

@arooni

/set weechat.look.buffer_notify_default message

this way the hotlist_changed signal will not be triggered for low message (join/part/quit...). But if you pasted all the line from my config you probably already have this setting set to this value

this is an excellent question but that represent some issues:

if the buflist is no more refresh on this signal the buffers name in the buflist will no more be colored and the number of unread message will not be refresh too. I created an issue a few weeks ago to ask flashcode to add a new signal that is triggered only when the priority change, for example if the buffer #weechat have no unread message and then a low message is receive, emit the new signal. Then if another low message is receive, do nothing, but if a message with higher priority, a message or a highlight is received, then emit that signal, at least this way the buffer name color would be refresh and correct but you would not be able to display the number of unread messages. The issue is here if you want to thumbs it up to encourage flashcode to implement it

Sorry if anything is hard to understand, as english is not my native tongue

EDIT: and btw you can't disable this signal it is hardcoded :(

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Sep 4, 2021

I had to delete outdated comments because the page was loading so slowly, I apologize if some of you were relying on some comments but most of them were very outdated since this configuration is actively developed. I choose to keep only the comments of the current years so now the page is a lot more responsive!

@agonzal

This comment has been minimized.

Copy link

@agonzal agonzal commented Sep 7, 2021

I was able to set the title color_bg and status color_bg to fit my needs but I am not able to see where I need to make the change to get the tabs (highmon, newsmon, chatmon, sys) to also be a different bg color. I see @rpfernandezjr was able to change the color. When I click into that window, the title color indeed changes (active vs inactive) but haven't been able to get the tabs, any ideas?

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Sep 7, 2021

@agonzal

Hi,

to change the bg color of the tabs you have to modify the buflist.format.buffer option. Replace any occurence of 31 which is the color of the active tab background and 24 which is the color of the inactive tab background

@agonzal

This comment has been minimized.

Copy link

@agonzal agonzal commented Sep 7, 2021

@pascalpoitras thank you for that, now I can say, it is complete! One can appreciate the amount of work put into this setup... /me tips hat!

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Sep 7, 2021

@agonzal thanks! if you have any other questions don't hesitate :)

@agonzal

This comment has been minimized.

Copy link

@agonzal agonzal commented Sep 8, 2021

I guess is it possible to change the bg color (which is maybe 24 now) for the server headings in the buflist? I want to have a uniform look all around and want to go darkgray

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Sep 8, 2021

@agonzal

yes find the

/trigger set render_buflist regex ...

line in the config and change the 31 color to the color you want

do the same for the buflist.format.* options and plugins.var.buflist.format.* options

In the future I might add an option to easily change that but it add more evaluation and the buflist is already slow

@gngrn1nja

This comment has been minimized.

Copy link

@gngrn1nja gngrn1nja commented Oct 1, 2021

thanks for all the help! awesome config/script btw!

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Oct 1, 2021

@gngrn1nja you are welcome :) I will delete some of the comments since they were nearly 30 and I try to keep the page fast

@Tahvok

This comment has been minimized.

Copy link

@Tahvok Tahvok commented Nov 8, 2021

I'm getting the following error with the buflist script:

Too few arguments for command "/bar set" (help on command: /help bar)

I'm trying to copy only the buflist from the scripts, and I'm unable to get anything displayed on the left - I just have a black column right now, and then I saw that I'm getting this error whenever I'm trying to resize it - so it might be related.

@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Nov 8, 2021

@Tahvok

what is the output of the following command

/v

@Tahvok

This comment has been minimized.

Copy link

@Tahvok Tahvok commented Nov 9, 2021

@pascalpoitras

WeeChat 3.3 [compiled on Sep 29 2021 03:55:37]
@pascalpoitras

This comment has been minimized.

Copy link
Owner Author

@pascalpoitras pascalpoitras commented Nov 9, 2021

@Tahvok

you need weechat 3.4 for the buflist as stated in the buflist section

for now, if you don't want to upgrade to 3.4 you can restore the default buflist settings with the following command:

/unset -mask buflist.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment