8

WeeChat操作各种聊天软件

 3 years ago
source link: http://maskray.me/blog/2016-08-13-weechat-rules-all
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

WeeChat操作各种聊天软件

WeeChat

把Facebook Messenger、Google Hangouts、IRC、QQ、Telegram、Twitter、微信等整合起来,用同一个客户端WeeChat控制。配置文件:https://github.com/MaskRay/Config/tree/master/home/.weechat/,参考https://pascalpoitras.com/my-weechat-configuration/

效果图

效果图

界面参考https://gist.github.com/pascalpoitras/8406501,UI显示成这样主要靠autosort.pybuffers.pl,以及文中提到的Bar input。

autosort.py

把相同server的buffers顺序编号

bot2human.py

/set python.bot2human.bot_nicks "tg2arch tox2sync xmppbot teleboto teleboto_ Orizon NyaaTelegram tg2gzlug d3tgbot tg2linuxba NyaaCat aosc-telegram XiaoT_bot"

buffers.pl

窗口左侧sidebar显示buffers

我的wechatircd/telegramircd使用--join new/part一个channel后下次收到消息仍能自动加入,觉得一个群烦了就用/mode +m屏蔽,下次收到消息就不会自动加入了。

highmon.pl

参考https://pascalpoitras.com/2013/08/09/weechat-highlight/

/set weechat.look.highlight security,update
/set weechat.look.highlight_regex .*\bHi\b.*\bplease\b.* # 对所有buffer有效
/autosetbuffer add irc.bitlbee.#twitter highlight_regex . # 安装buffer_autoset.py,highlight所有bitlbee的`#twitter` buffer中内容。

匹配highlight规则的行会显示在highmon窗口里。

notify.py

pastebin.py

我的插件:https://github.com/MaskRay/Config/blob/master/home/.weechat/python/autoload/pastebin.py,用于上传本地文件到pastebin并把链接贴到当前buffer。

/paste /tmp/a.jpg用img.vim-cn.com图床分享图片,在当前buffer插入链接

/paste /tmp/a.txt用cfp.vim-cn.com pastebin分享文件,在当前buffer插入链接

Slack

让team owner开启IRC gateway:https://get.slack.help/hc/en-us/articles/201727913-Connecting-to-Slack-over-IRC-and-XMPP

Bitlbee

安装aur/bitlbee-libpurple-unicode-channel(或原版aur/bitlbee-libpurple)

参考https://www.bitlbee.org/user-guide.html#set_utf8_nicks&bitlbee buffer里输入

set utf8_nicks true
set nick_format %full_name


set show_offline true

/etc/bitlbee/bitlbee.conf[settings] section的Proxy可以设置proxy。

&bitlbee buffer:

  • register
  • /oper any $password

Facebook Messenger

aur/bitlbee-facebook-git

https://wiki.bitlbee.org/HowtoFacebookMQTT

创建一个channel显示所有联系人:

/j &facebook
channel facebook set account facebook
channel facebook set show_users 'online@,special%,away+,offline'

Google Hangouts

https://wiki.bitlbee.org/HowtoGtalk

支持OAuth认证,不需要输入密码。

创建一个channel显示所有联系人:

/j &gtalk
channel gtalk set account gtalk
channel gtalk set show_users 'online@,special%,away+,offline'

Twitter

https://wiki.bitlbee.org/HowtoTwitter

Google Hangouts的联系人,&bitlbee中nick会优先使用Contacts里设置的备注名。设置utf8_nicks后就不会显示为乱码。

微信网页版

https://github.com/MaskRay/wechatircd

如果需要定制命令行选项的话,把/usr/lib/systemd/system/wechatircd.service复制到/etc/systemd/system/wechatircd.service,添加--ignore 不想看到的群名子串1 不想看到的群名子串2选项

systemctl enable --now wechatircd
/server add wechat 127.1/6667 -autoconnect

QQ网页版

https://github.com/MaskRay/webqqircd

systemctl enable --now webqqircd
/server add qq 127.1/6668 -autoconnect

如果需要定制命令行选项的话,把/usr/lib/systemd/system/webqqircd.service复制到/etc/systemd/system/webqqircd.service,添加--ignore 不想看到的群名子串1 不想看到的群名子串2选项

Telegram网页版

https://github.com/MaskRay/telegramircd

systemctl enable --now telegramircd

如果需要定制命令行选项的话,把/usr/lib/systemd/system/telegramicd.service复制到/etc/systemd/system/telegramicd.service,添加--ignore 不想看到的群名子串1 不想看到的群名子串2选项

服务器上运行WeeChat

WeeChat不支持以WeeChat为客户端的relay。浏览器desktop notification不方便定制,显示效果也差,快捷键不够方便,因此不想用Glowing Bear。

把wechatircd和浏览器运行在服务器上,可以持续运行无需每日扫码,参见https://maskray.me/blog/2016-07-06-wechatircd-webqqircd-without-scanning-qrcode-daily

我让WeeChat也运行在服务器的一个名为weechat的tmux session,本地用ssh访问:

SSH_AUTH_SOCK= ssh -R 9010:0:9010 -tX linode-ca 'tmux a -t weechat'

由于notify-send不能通过网络传输,自制简易的notification服务:

Share Comments

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK