> ~ biozz / Blog

WeeChat setup 2024-01-07

A brief walkthrough of how to setup WeeChat in 2024

Reading time: 4m (688 words)

I’m a fan of TUI (text user interface) apps. Currently, I’m writing this blog post in NeoVim and have a nice file tree open on the side. I would likely use NeoVim for all my tasks, just like Emacs users do. However, there isn’t a decent IRC plugin for NeoVim, so I resort to standalone terminal IRC clients instead.

WeeChat looked the most appealing due to its wee-slack plugin. However, I will discuss plugins in more detail in a future post. In this one, I’d like to focus on installation and setup to keep everything on one page for you and future me to avoid looking throughout the internet.

Before we start I have to mention the WeeChat FAQ, it helped me a lot and continues to do so. I highly recommend it if you are stuck with something.

General settings

I will also focus on a Mac setup, because it’s my daily driver. After installing WeeChat with brew install weechat you can start configuring it:

  • /mouse enable - enables mouse, which is a life-saver. After that WeeChat becomes more intuitive and manageable.

All of the settings below can be accessed with /fset. While in an /fset buffer you can enter search words to find the setting you need. It is using some sort of glob or regex mechanism for filtering, so to reset the filtered view you send * (star).

These are the ones that also make WeeChat feel more like a modern chat client:

  • /set weechat.bar.buflist.size_max 25 - makes chat list on the side smaller, freeing up more space for the chat area
  • /set weechat.look.buffer_time_format "" - removes timestamps from the messages, so there is less cognitive load (the default is "%H:%M:%S")
  • /set weechat.look.prefix_align none - removes nicks alignment and it makes the chat area more fluid and less strict
  • /set weechat.look.align_end_of_lines prefix - makes it so the text is not vertically aligned based on the length of the nick, but instead goes under to save some space

I typically remove all unnecessary sidebars:

  • /bar hide <tab>, /bar toggle <tab> - <tab> means you can use the Tab key to cycle through the bar types

The last thing I’d like to mention in terms of general settings is filters. You might not need to change these since I may have turned them off while experimenting. Filters employ several heuristics to intelligently filter messages. For instance, they only display certain types of messages under specific conditions.

  • /set irc.look.smart_filter on - enables smart filters
  • /filter add irc_smart * irc_smart_filter * - enables the main smart filter
  • /filter add joinquit * irc_join,irc_part,irc_quit * - removes join/part messages intelligently

Connection settings

Since the general stuff is described quite well in the official Quickstart, I would like to have an unusual example: connecting to twitch.tv IRC.

You first need to generate an OAuth token. And this might look as a sketchy part, but the website has been around for more than 10 years now. You go to twitchapps.com/tmi, login using Twitch account and get a token, which is in a form of oauth:something.

The alternative way would be to create a personal Twitch app through the developer console and generate the token using the implicit grant flow.

Once you have a token:

  • /server add twitch irc.chat.tiwtch.tv/6697 - add a server (mind the / forward slash separating host and port)
  • /set irc.server.twitch.password "oauth:something" - use the token you got from tmi url above
  • /set irc.server.twitch.nicks "mynickname" - set your nickname
  • /set irc.server.twitch.capabilities "twitch.tv/tags,twitch.tv/commands,twitch.tv/membership" - these will enable special Twitch capabilities, which are useful mainly for bots, but it is nice to have those just in case

At this point you can /connect twitch and /join #channel.

That is all I wanted to share in this post. The most powerfull feature of WeeChat is plugins, or as they called “scripts”. I plan to write another post about the scripts. And maybe another one about WeeChat flows, tips and tricks.

I have only one tip left in this post: did you know, that you can subscribe via RSS not only to all of my posts in a blog, but to pojects, series and tags?

More posts in WeeChat series:

There is nothing in here at the moment