Weechat Slack



There are two central problems that I faced with Slack: 1. Slack feels like I am developing in Eclipse, in a Windows VM, on an old Linux laptop. Where does all the bloat come from? It can't even have more than one channel open at a time! 2. In some cases, Slack can [force you to log out][SlackTimeout] after 12 hours, say. I understand why you would check that box as an IT admin, but I will show you that Slack is currently not enforcing this policy, and so I'd prefer to not be subject to it. 😼 ## Good Slack Clients The first problem is rather easy to solve, you simply use an alternative client. There are three options I am aware of: - Using [WeeChat][] with the [WeeSlack][] plugin. I also recommend the [WeeEdit][] plugin to post multi line messages, especially for those code blocks. Finally, I use [WeeAutosort][] because the list of slack channels in WeeChat is a little confusing otherwise. This client is certainly your best option if your top priority is to go open source, to get it for free, or to use it on the command line. And it is a really good way to use Slack, too. I like it very much. - You can use [Pidgin][] with the [slack-libpurple][SlackLibPurple] plugin. Unfortunately, I have to say that this works rather poorly and I mention it here only to be complete. I thoroughly recommend WeeChat if you are absolutely not willing to use a commercial and closed source program; it is better to use WeeChat with [WeeSlack][] in a terminal for Slack than to use the Pidgin plugin. - If you are willing to pay $20 for your happiness, you should buy [Ripcord][] (Win/Linux/Mac supported). Even though it is in Alpha, it is the best Slack (and Discord!) client I have used. It supports Slack features in a more natural way because it is built specifically to do so, where in WeeChat some things may be awkward (inline images, navigating threads, etc). It is fast, has a low memory footprint, feels snappy, and gives you tabs for channels, DM's and threads. It is my weapon of choice. [AndroidEmulator]: https://developer.android.com/studio/run/emulator [AndroidEmulatorNetworking]: https://developer.android.com/studio/run/emulator-networking [Ripcord]: https://cancel.fm/ripcord/ [MITMProxy]: https://mitmproxy.org/ [Pidgin]: https://pidgin.im/ [HAR]: https://en.wikipedia.org/wiki/HAR_(file_format) [SlackLibPurple]: https://github.com/dylex/slack-libpurple [WeeChat]: https://weechat.org/ [WeeSlack]: https://github.com/wee-slack/wee-slack [WeeSlackSecure]: https://github.com/wee-slack/wee-slack#4-add-your-slack-api-keys [SlackTimeout]: https://slack.com/intl/en-de/help/articles/115005223763-Manage-session-duration-?eu_nc=1 [SlackAPI]: https://api.slack.com/web [SlackOverflow]: https://stackoverflow.com/questions/11012976/how-do-i-get-the-apk-of-an-installed-app-without-root-access [NougatChanges]: https://android-developers.googleblog.com/2016/07/changes-to-trusted-certificate.html [WeeEdit]: https://raw.githubusercontent.com/keith/edit-weechat/master/edit.py [WeeAutosort]: https://raw.githubusercontent.com/de-vri-es/weechat-autosort/master/autosort.py [WeeOTR]: https://raw.githubusercontent.com/mmb/weechat-otr/master/weechat_otr.py ## Loot Slack Tokens from Mobile Now if you want to come along and get around periodic logouts in Slack with me, let's get started. So Slack be like > For added security, you can limit how long your members are signed in to Slack on their desktop (we call this a session duration). When you set a session duration, your members will have to sign back in periodically. But then Slack adds some small print like: > **Note:** Session duration only applies to the Slack on the desktop app and in a web browser. With session duration turned on, members won't be signed out of their Slack mobile apps. And well, it seemed to me that there is really [only one web API that handles all of these][SlackAPI]. And it uses tokens for authentication. And that sounded to me like I could just generate an immortal token on my mobile app and use that in any of the above clients to live happily ever after.
**TL/DR: Yea, that totally works.**
What I have *not* done is try to stuff that token into my browser cache and see if I can prevent the original Slack client from logging me out periodically. I didn't do that because I couldn't care less about the original Slack client, I can never go back to it after using [Ripcord][]. Once we have looted a token from mobile, it is _rather_ easy to use it with the alternative clients I listed above. Both [Pidgin][] and [WeeChat][]/[WeeSlack][] require a token to log in to Slack, and you can just give them the mobile token. With [Ripcord][] there's just a tiny bit of work involved, but I will get to that later. Let's do the fun part first: Looting an immortal Slack token from the Slack mobile app! I am sure there are several ways to go about this, but I chose to use SSL MITM sniffing: 1. Install Slack in an [Android emulator][AndroidEmulator]. 2. Log in to Slack. 3. Hook that emulator to a [MITMProxy][]. 4. Sniff that Slack traffic as it logs in. 5. Loot. That. Token. So yea, that works. I know that others were successful in extracting the token from the data stored by Slack on the Android device, but you need to have root for that. Here's a step by step guide for how I did it: 1. Install the emulator for sniffing **like this**: It is important to use the android-23 API here because using a later image will make it unbearably hard for you to use [MITMProxy][]: [Starting with Android 7, user certificates are no longer trusted by apps][NougatChanges]. 2. You can now run your emulator with emulator -avd C3PO, but it will not have a PlayStore. 3. You can get a Slack APK from some website that pretends to scrape the PlayStore, but I do not like that idea. To get a gem mint original copy of the latest Slack APK, I recommend installing a **second** emulator as follows: now you can launch R2D2, which will have a PlayStore, and download Slack. 4. To get the Slack APK off of R2D2, we use some magic incantations that the [StackOverflow gods bestowed upon us][SlackOverflow]. The following lists all packages: You probably won't need it, though. Most likely, you can get the path to the Slack APK with the following command: and then just adb pull that APK, push it to C3PO and install that sweet, fresh, original Slack. I have a little Python script that should do this for you automagically: 5. Install [MITMProxy][], and [use it as a proxy for C3PO][AndroidEmulatorNetworking]. 6. Start sniffing! What you are looking for is something that looks like this: More precisely, it matches the following regular expression: This is your undying Slack token. Be **very**, **very** careful with it. Anyone with that token can pretend to be you on whatever Slack you are logged in to. In the [WeeSlack][] README, there is a [section which also explains how to securely store this login][WeeSlackSecure] and I strongly recommend doing that. On Windows, [Ripcord][] is unable to read cached logins from other installs, so I am pretty sure some work was put into storing credentials in a secure manner, but I haven't reverse engineered it to verify that. It's probably always a good idea to slap some full disk encryption on top of everything! ## Importing to Ripcord Finally, let me explain how to import your token into [Ripcord][]. The way you do this is by adding a Slack account via browser import and once you have stored the request from your browser as a [HAR][] file, say slack.har simply replace every occurrence of something that looks like a token with the one you looted. For example, you could do this: And then, simply import slack.immortal.har.

A WeeChat script for Slack.com. Supports threads and reactions, synchronizes read markers, provides typing notification, etc. Which is the best alternative to tg? Based on common mentions it is: Rainbowstream, Wee-slack, Weechat, Ddgr, Cordless or Instagram-terminal-news-feed. A WeeChat native client for Slack.com. Provides supplemental features only available in the web/mobile clients such as: synchronizing read markers, typing notification, threads (and more)! Connects via the Slack API, and maintains a persistent websocket for notification of events. Wee-slack doesn't use the Slack IRC gateway. Element is the ultimate way to openly collaborate with other developers over the open Matrix network, whether they’re natively in Matrix or connected via IRC, Gitter, Slack, Discord, or elsewhere. Element is incredibly proud to support Gitter, the only developer-focused chat platform.

Weechat Slack

Recently I’ve started to use WeeChat to connect to IRC. My earlier client was Hexchat, and is currently a fallback in case I am not able to get familiar with intricacies of weechat. Here I am listing some settings that I’m using to do a basic makeover.

My fascination with WeeChat started after I read fhackdroid’s blog on WeeChat and tmux. The client looked amazing. And then I couldn’t help myself but try it.

For starters I just followed the getting started guide on WeeChat’s official website. And after using it for some time I wanted it to change how somethings looked.

The first thing that bugged me was the huge size of channel list. Initially I thought if it was possible to do a resize like that in tmux, but I wasn’t able to come accross any such option. Then I came across a command window. I tried to do resize, split, merge, but I cam across other interesting features than the channel list.

Even if I found out how to change the size, there must be more configurations to be played with. So to figure out how to see, tinker with current settings. I don’t remember how, but I eventually stumbled upon this great command set, and now it was like weechat screamed to me. Customize all you can, here I am! Ah, the painstakingly long list was lovely and at them same time intimidating.

While I was trying combinations of keywords window, weechat, resize et al. I went to the official documentation a lot. And in the official documentation, I found my temporary abode. It too was exhaustive, but I was starting to love it. I eventually found where to resize the channel list in the screen layout option. Here the first thing I saw was, it’s not called a channel list here, it’s a buflist! Now with set and buflist and a shortcut ctrl + r that too I found in the documentation, I was ready to attack the large set of options now, to change the size of channel list buflist!

Slack

Then while searching I found the setting:

I don’t remember the initial value, but as soon as I changed the value to, say 20. Buflist shrunk. And that was my first victory!

From there on started another quest. To list separate servers separately. That is, channels under different servers should appear differently.

By the way, this was because, while lurking in #dgplug, I came to know about wee-slack, it is a WeeChat alternative, to the infamous, ram gulping, slack. I tried it out in a local slack group of college friends, and it too turned out to be amazing! (Though I had to remove some unused DMs and channels to make it more clutter free). A big big thanks to sayan and j605 who mentioned it. I didn’t knew what it was, so I couldn’t thank them then.

So while searching for separate channel list, based on servers, I came across weechat wiki on Github. And there I found this. Amazing configurations for buflist appearance!

For a starters, I tried out one or two of them, but then I grew more interested in modifying them. As I liked some features of one, some of another. Initially I was copying whole script by a single user from wiki just to try it out. Later I started to pick up lines from the config to try and see their effect. And a few minutes later, I was editing the one I liked the most 😛 (The first one on the wiki). I liked how it used a bullet symbol for servers and the color scheme it used, but from another theme I liked the tree like structure. So I copied the selected lines and made a new mix. It worked. But I wanted a little more. I wanted that, the current channel should be highlighted with a background, not just change in the color of the text. So I started comparing the different combinations. Which had this feature and which didn’t. Later I was able to narrow down to one thing that was responsible for this background. It was a , Yup, just a comma. Followed by the color of background.

More intrigued, I entered a colour name behind the comma. I had a sense of what it might do, and it did exactly the same! It changed the color of text in the highlight.

Next came the nick list. I don’t know how, but I remember as if it was there in the beginning, but now it wasn’t. This was easy fix. I just changed

It said that the default was on, I must’ve confused my mind with the Hexchat nicklist. The nicklist was on!

The naming of the variables in the set command’s menu was just great. It was easy to relate your thoughts with the settings. Like, indent in buflist determines how you want to specify the indent. (This was the one I modified to get the branches connecting to channels)

Weechat Slack Login

Another setting I changed was:

Weechat slack plugin

I’ve set it to 1 currently. Compared with Hexchat, it’s too low. But since it’s in minutes, I don’t expect it to add any latency (Though I could be wrong as I am not aware of the innards)

Weechat Slack

Weechat slack plugin

Weechat Slack

Currently I am trying to find how to modify the hotlist variable to only display message count, not low priority count like joins, quits etc. I’ve found some settings that change the hotlist_low parameter’s colours.

This is the buflist.conf that I am currently using. Don’t copy it to .weechat . As it is mentioned in the file, use /set to change the settings. Issues are welcome 🙂

This is just the experience of configuring a terminal chat client, by a naive. So please point out the errors if you find any. Suggestions are always welcome!

Ping me on irc: storymode7 at freenode. Let’s see what client I am using when you ping me up!

Weechat Slack Plugin

See you next time. Till then keep customizing 🙂

Weechat Irc Slack

storymode7





Comments are closed.