• Stars
    star
    352
  • Rank 120,622 (Top 3 %)
  • Language
    Lua
  • Created over 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A WeeChat script in Lua that implements the matrix.org chat protocol

Matrix Client script for WeeChat

Also known as WeeMatrix, this script is considered beta quality as not all functionality is in place and still has known bugs, and unknown bugs to be discovered and fixed.

Project Status and Alternative Client

While this script generally works for general usage, there's a new script that's more actively developed here: https://github.com/poljar/weechat-matrix

What is Matrix ?

Matrix is a new open source realtime federated chat protocol. You can read more about it on their website.

What is WeeChat ?

WeeChat is a super powerful CLI chat client that's extensible in many languages to allow for new protocols like Matrix.

What does it look like?

WeeChat in a terminal

weechat ncurses cli screenshot

WeeChat in a relay client Glowing Bear

weechat glowing bear

How to load and use the plugin

# Clone this repo
git clone https://github.com/torhve/weechat-matrix-protocol-script.git
# Copy the script into WeeChat's Lua dir
cp weechat-matrix-protocol-script/matrix.lua ~/.weechat/lua/
# Make a symlink into the autoload dir to load the script automatically when WeeChat starts
ln -s ~/.weechat/lua/matrix.lua ~/.weechat/lua/autoload/
# Start WeeChat
weechat

Helpful commands after starting WeeChat

# If you didn't put matrix.lua in autoload
/script load matrix.lua
# Set the two required settings. Look in WeeChat docs for secdata if you don't want to store passord in the clear. ( http://dev.weechat.org/post/2013/08/04/Secured-data )
/set plugins.var.lua.matrix.user username
/set plugins.var.lua.matrix.password secret
/matrix connect

# to display all the possible WeeChat Matrix settings:
/set plugins.var.lua.matrix.*
# to get a description for each option
/help plugins.var.lua.matrix.local_echo

When it connects it will create a WeeChat buffer called matrix that will act like the "server" buffer. Some errors messages and status messages will appear in there on certain events like joing/invite/connection problems/etc. It will also create buffers for any rooms that you have already join on this or any other client.

Most IRC commands you would expect work exists, like /join /query /part /kick /op /voice /notice, etc. There might be slight differences from normal usage.

There's a /create room name to create a new room with a given name.

If at any point you get any errors you can always try reloading the script to refresh the state by issuing the command

/script reload matrix

If you get invited to a room, the script will autojoin, which is configurable behaviour.

Configuration

Given Matrix display names can be quite long, we recommend limiting the size of the prefix and username lists:

/set weechat.look.prefix_align_max 20
/set weechat.bar.nicklist.size 20

To get an item on your status bar to show users currently typing in the active room buffer add the matrix_typing_notice item to the status bar like this:

/set weechat.bar.status.items [buffer_count],[buffer_plugin],buffer_number+:+buffer_name+{buffer_nicklist_count}+buffer_filter,[hotlist],completion,scroll,matrix_typing_notice

It's helpful to use tab-complete after typing the option name to get the current setting, and then just add it to the end

To hot-update the plugin

git pull
/script reload matrix

How to get WeeChat & Lua deps up and running on Debian/Ubuntu:

sudo apt-get install weechat lua-cjson

Note that the weechat in jessie (1.0.1) is quite old compared to upstream and is missing many bugfixes. This plugin may not work with older versions. There are unofficial packages here.

How to get WeeChat & Lua deps up and running on CentOS/RHEL:

sudo yum install epel-release
sudo yum install weechat lua lua-devel luarocks
sudo luarocks install lua-cjson

How to get WeeChat & Lua deps up and running on OSX:

using brew (recommended; it's a simpler faster install and ships newer weechat than MacPorts):

brew install lua
luarocks install lua-cjson
brew install weechat --with-lua

using MacPorts:

sudo port install weechat +lua
sudo port install luarocks
sudo luarocks install lua-cjson
# You may need to substitute the version number for whatever version of lua macports installed
export LUA_PATH="/opt/local/share/luarocks/share/lua/5.3/?.lua;/opt/local/share/luarocks/share/lua/5.3/?/init.lua;$LUA_PATH"
export LUA_CPATH="/opt/local/share/luarocks/lib/lua/5.3/?.so;$LUA_CPATH"

How to get WeeChat & Lua deps up and running on Arch:

sudo pacman -S lua weechat
# You can grab lua-cjson from either the AUR:
pacaur -y lua-cjson
# Or through the luarocks package manager:
luarocks install lua-cjson

Encryption

The current encryption implementation in weechat-matrix-protocol is incompatible with Matrix. It was written for an early proof-of-concept version of the protocol that used Olm, and does not work with the current Matrix protocol which utilises Megolm.

Help appreciated to get it working!

License

MIT

More Repositories

1

LuaWeb

A very simple blog engine using openresty, nginx, lua, markdown, git and redis
Lua
170
star
2

Amatyr

Amateur weather graphs using d3 js, watch js, rivets js, lua, postgresql, nginx
JavaScript
136
star
3

openresty-docker

Dockerfile and sample settings for Openresty/Lua development using Docker
Nginx
87
star
4

infping

Parse fping output, store result in influxdb 0.9
Go
65
star
5

lua-resty-letsencrypt

Lua script for Nginx to automatically get certificates from LetsEncrypt CA
Lua
65
star
6

pix

Photo gallery built with Lapis/Moonscript/Lua/PostgreSQL/Redis/Openresty/HTML5/Angular
JavaScript
38
star
7

blag

My blog articles
22
star
8

photongx

A photo gallery with next to no chrome, written in lua deploying with nginx
JavaScript
20
star
9

lapis-docker

Dockerfile for lapis
Shell
15
star
10

saltvirtweb

A simple virt mgmt admin web interface for salt and salt API
12
star
11

states

My salt states
Shell
12
star
12

cubesensor

My own frontend and API for cubesensors
JavaScript
9
star
13

Weechat-scripts

Weechat scripts
Python
8
star
14

lapiswiki

A very simple wiki-like web editor built in Lapis/Moonscript with the WYSIWYG CKEditor
MoonScript
8
star
15

gomirc

Matrix <=> IRC bridge in Go
Go
8
star
16

salt-xmpp

A simple Salt XMPP gateway example
Python
8
star
17

saltibot

IRC bot listening to salt event bus and publishes filtered events and functions to IRC
Python
5
star
18

weechat-docker

Dockerfile for running development version of WeeChat
C
4
star
19

bash

Online Quote DataBase
MoonScript
4
star
20

Nyfyk

HTML5 RSS Reader app. SQLite3+newsbeuter+openresty-backend
Lua
3
star
21

lsurl

Super simple URL shortening service in Lua/MoonScript
MoonScript
2
star
22

ip

A simple web service in Openresty returning information about the HTTP request
HTML
1
star
23

weechat-urls

Flask web project to display URLs from weechat slite database, optimized for tablets
JavaScript
1
star
24

comics

Java
1
star
25

lurls

A link viewer for IRC bot
JavaScript
1
star