Skip to content

weechat Notes

chris edited this page Feb 14, 2024 · 16 revisions

Contents

Universal IRC commands

To search for a particular channel on a specific server

/msg alis LIST *searchterm*

To set IRC realname setting

/set irc.server.freenode.realname β€œChris”

When changing the realname setting you will have to disconnect / reconnect to the server for the change to percolate.

Customizing weechat setup

Enable SSL with weechat

Ex

/set irc.server.freenode.ssl on
/set irc.server.freenode.ssl_verify on
/set irc.server_default.sasl_mechanism dh-blowfish
/set irc.server.freenode.sasl_username "mr-fancy-username"
/set irc.server.freenode.sasl_password "mr-fancy-password"

Set autoconnect and authenticate with nickserver

Ex

/set irc.server.freenode.autoconnect on
- /set irc.server.freenode.command '/msg NickServ identify "mr-fancy-password"
/set irc.server freenode.command "/msg nickserv identify ${sec.data.freenode}"

Working with Colors 🌈 in WeeChat

To see what colors are supported within a weechat session

/color

A good template for setting colors within weechat.

Toggle timestamps

To toggle timestamps see πŸ‘‰ click me

TL;DR;DC

On Weechat >= 1.8

/trigger add cmd_toggle_time command toggle_time
/trigger set cmd_toggle_time regex ""
/trigger set cmd_toggle_time command /mute /set weechat.look.buffer_time_format "${if:${weechat.look.buffer_time_format}==?${tg_argv1}:}"

To hide the timestamps with the newly created trigger

/toggle_time

To show the timestamps

/toggle_time %H:%M:%S

To extend on the above toggle timestamp solution

/alias add toggle_time_2 /alias add tt /toggle_time\;/toggle_time_1
/alias add toggle_time_1 /alias add tt /toggle_time %H:%M:%S\;/toggle_time_2

Once the above aliases have been created, run

/toggle_time_2

Then bind alt + t to toggle timestamps.

key bind meta-t /tt

Scripts

To get a list of the current loaded scripts within a weechat session

/script list

To permanently remove a script from starting up in future weechat sessions

/script remove [mr_fancy_pants_script]

To unload / remove a script from weechat

/script unload [name_of_script]

Example

/script unload shortenurl

To toggle the buffer list, ie. the list of channels within weechat.

/bar toggle buflist

useful for when trying to read a description of a plugin for weechat.

Scripts / Useful Links

weechat.org > user guide > scripts

Save & restore weechat servers & channels to disk

To auto-join a channel on the freenode server when starting weechat.

- /set irc.server.freenode.autojoin "#channel1,#channel2"
+ /script
  • Find autojoin.py and press i then enter to install.
/autojoin --run
/layout store
/save

Credit πŸ’³

To get weechat notification center support on macOS the below weechat script helps. weechat-notification-center

weechat will need to be built with python support.

If installing weechat via homebrew make sure to enable python 🐍 support

brew reinstall weechat --with-python

Updating weechat settings that have been encrypted with git-crypt

  • make sure git repo is in an unlocked state
git-crypt unlock

Verify files have been unlocked by opening them in a text editor

Update weechat settings
/autojoin --run
/layout store
/save
Copy updated weechat settings to their corresponding encrypted file name.
for f in irc.conf sec.conf weechat.conf plugins.conf
  cp -iv $f $f.shu
end
Add, commit, then lock the changes
git add .
git commit -m "weechat setting updates"
git-crypt lock
git push changes to remote repo
git push

TODO

  • construct a more streamlined workflow for updating files that have been encrypted using git-crypt

Weechat installation Notes using linuxbrew

  • make sure the linuxbrew implementation of perl is installed on the system and is properly configured in the $PATH ie. the linuxbrew version perl is ahead of the system version of perl in the $PATH

Weechat will compile from source using linuxbrew, however if linuxbrew perl is not installed, Weechat will compile from source however, the perl plugin will fail to load when trying to load from weechat. Β―\(ツ)/Β―

  • To install weechat from source using linuxbrew run the below command
brew (re)install weechat --with-perl --with-python --with-ruby --build-from-source

If all goes well, weechat should load perl the next time it is started, and can tested by running the following command within weechat

/script install multiline.pl

Useful keybindings / macros

To toggle the nick list in weechat with a sane key binding

/key bind meta-n /bar toggle nicklist

To toggle the buffer list in weechat with a sane key binding

/key bind meta-b /bar toggle buflist

The meta key is the option / alt

Useful Links πŸ”—

Useful Links - Notifications

TODOs

  • figure out a way to toggle timestamps using the meta key + t then + s
  • Review the following link πŸ”— for setting up Bitlebee within weechat
  • Review the following link πŸ”— for setting up Slack chat within weechat
Clone this wiki locally