Mattermost GTK is a native GTK4 client for Mattermost on Linux.

I wrote Mattermost GTK in Vala. I wanted a Mattermost client that uses normal Linux desktop widgets. The interface is built with GTK4, including the message rendering, rather than an embedded web browser.

The app supports channels, direct messages, threaded conversations, emoji reactions, and file attachments. Replies can be opened alongside a channel, so you can read a thread without losing the main conversation. There is also a separate view for keeping up with threads across different channels.

Mattermost GTK showing an arcade conversation, an image attachment, and a thread with syntax-highlighted Python code

A chat application’s message list is more involved than it might initially seem. Older messages need to load as you scroll, images can change the height of a message after it appears, and new messages should not move the conversation away from what you are reading. The app uses a virtualized message list and a local SQLite cache to handle the history without creating a widget for every message in a channel.

Communication with the server uses libsoup for HTTP requests and a WebSocket connection for live updates. Markdown is parsed with libcmark and rendered as GTK widgets, with GtkSourceView providing syntax highlighting for code blocks. Login credentials are stored through libsecret.

The source code is available on my Forgejo instance.

Screenshots

These screenshots use a test server populated with conversations about some of my interests. Click a screenshot to view it at full size.

Here is a channel and its movie-night thread, discussing Hackers (1995).

A Hackers movie-night conversation with emoji reactions and an eight-reply thread open beside it

The Threads view collects followed conversations in one place and keeps track of unread replies. This one is a discussion about what to read next.

The followed-threads view with a science-fiction reading list and replies about Gibson, Stephenson, Dick, Liu, Egan, and Watts

Messages can contain tables, lists, and attachments. A pizza recipe makes a reasonable test of all three.

A pizza discussion showing a formatted dough recipe, emoji reactions, and an attached text file

Message and file search opens beside the conversation. Search terms can be restricted by channel, author, or date, and results link back to the original messages.

A pinball conversation and search results for practice, with matching words highlighted and separate message and file tabs