Difference between revisions of "WeeChat"

From ArchWiki
Jump to: navigation, search
(Guides)
m (Mobile device notifications: Removed stray newline)
 
(53 intermediate revisions by 30 users not shown)
Line 1: Line 1:
 
[[Category:Internet Relay Chat]]
 
[[Category:Internet Relay Chat]]
{{Stub}}
+
[[ja:WeeChat]]
{{Article summary start}}
+
{{Style|See [[Help:Style]] and related.}}
{{Article summary text|WeeChat is a highly extendable and feature rich IRC Client currently under heavy development.}}
+
{{Article summary heading|Alternative Clients}}
+
{{Article summary wiki|irssi}}
+
{{Article summary wiki|XChat}}
+
{{Article summary end}}
+
==Installing==
+
{{Pkg|WeeChat}} is available in the ['''extra'''] repo. Install by running:
+
{{bc|# pacman -S weechat}}
+
There is also {{AUR|weechat-git}} in the AUR, install with your favorite [[AUR Helper|AUR Helper]] or [[makepkg]].
+
  
==Running WeeChat==
+
{{Related articles start}}
 +
{{Related|IRC channels}}
 +
{{Related|IRC}}
 +
{{Related|irssi}}
 +
{{Related|HexChat}}
 +
{{Related articles end}}
 +
'''WeeChat''' is a highly extendable and feature rich IRC Client currently under heavy development.
 +
 
 +
== Installing ==
 +
 
 +
[[Install]] {{Pkg|weechat}} from the [[official repositories]]. The development version {{AUR|weechat-git}} is available in the [[AUR]].
 +
 
 +
== Running WeeChat==
  
 
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat.  
 
WeeChat is going to have multiple interfaces at some point, run '''weechat-[interface]''' to start WeeChat.  
  
As WeeChat currently only has a Ncurses interface the command to start WeeChat is:
+
As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:
{{bc|$ weechat-curses}}
+
 
 +
$ weechat
  
 
== Configuration ==
 
== Configuration ==
  
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.
+
You can configure WeeChat in 3 ways: using WeeChat's internal commands; using '''iset'''; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run {{ic|/save}}, so if you are editing a .conf file in an editor, be sure to run {{ic|/reload}} from the console before exiting, otherwise your changes will be lost.
  
 
=== Internal commands ===
 
=== Internal commands ===
 +
 +
The {{ic|/set}} command follows this structure:
 +
{{ic|/set [file.name].[section].[directive]}}
  
 
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command:  
 
You can get a list of all configurable options by typing {{ic|/set}} in the '''weechat''' buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: {{ic|/set irc.server.*}} or {{ic|/set *server*}} as an example. You can get help on each option with the {{ic|/help}} command:  
Line 31: Line 38:
 
=== Internal menu-based ===
 
=== Internal menu-based ===
  
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9, run:
+
For a more convenient method, install the '''iset''' script. If you have weechat 0.3.9 or newer, run:
  
 
  /script install iset.pl
 
  /script install iset.pl
Line 47: Line 54:
 
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [http://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].
 
The .conf files for WeeChat are saved to {{ic|~/.weechat}}. These files are not commented. Detailed information can be found within the program itself (see '''Internally''' above), or WeeChat's [http://www.weechat.org/files/doc/stable/weechat_user.en.html user guide].
  
==Connecting to a server==
+
{{Tip|in case you want to move {{ic|.weechat}} directory somewhere else (like in your ''''$XDG_CONFIG_HOME'''), use this option : {{ic|$weechat -d $XDG_CONFIG_HOME/weechat}}}}
 +
 
 +
== Connecting to a server ==
 +
 
 +
{{Note| Using '''/connect''' to connect to a temporary server is disabled by default if you're using 1.1+ [https://weechat.org/files/releasenotes/ReleaseNotes-devel.html#_temporary_servers_disabled_by_default_with_connect Release Note]
 +
 
 +
Enable by '''/set irc.look.temporary_servers on'''
 +
 
 +
}}
 +
 
 
You can connect to a IRC server by using '''/connect'''.
 
You can connect to a IRC server by using '''/connect'''.
 +
 
  /connect chat.freenode.net
 
  /connect chat.freenode.net
 +
 
Or if there is already a '''Server''' setup you can use:
 
Or if there is already a '''Server''' setup you can use:
 +
 
  /connect freenode
 
  /connect freenode
  
==Creating a Server profile==
+
== Creating a Server profile ==
 +
 
 
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.
 
If you plan on connecting to a server more than once it may be beneficial to create a '''Server'''.
 +
 
  /server add example irc.example.net/6667
 
  /server add example irc.example.net/6667
 +
 
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''
 
Would create the server '''example''' which would connect to '''irc.example.net''' on port '''6667'''
  
 
See the WeeChat documentation and '''/help server''' for more information.
 
See the WeeChat documentation and '''/help server''' for more information.
  
==Configuring SSL==
+
== Configuring SSL ==
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC Channel|#archlinux]] is, support SSL.
+
 
 +
Many IRC servers, including [https://freenode.net/ freenode] where [[IRC channel|#archlinux]] is, support SSL.
  
 
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:
 
If you're making a server with '''/server''', add the SSL port (usually 6697) and '''-ssl''' to the end of the line. For example:
Line 71: Line 94:
 
  /connect chat.freenode.net/6697 -ssl
 
  /connect chat.freenode.net/6697 -ssl
  
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024'''}}
+
{{Warning|Some servers need the '''ssl_dhkey_size''' value changed to something lower. For example, if you're using freenode you'll need to set '''/set irc.server.freenode.ssl_dhkey_size 1024''' or '''/set irc.server.chat.freenode.net.ssl_dhkey_size 1024''' (see the server log)}}
  
{{Box BLUE|Note:| Different servers may have a different port than 6697 - this is server specific.}}
+
{{Note|Different servers may have a different port than 6697 - this is server specific.}}
  
==Tips and Tricks==
+
You may also want to change the location where WeeChat looks for trusted authorities (the default value is {{ic|%h/ssl/CAs.pem}} which translates to {{ic|~/.weechat/ssl/CAs.pem)}}:
 +
 
 +
/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"
 +
 
 +
=== OFTC ===
 +
 
 +
If you wish to connect to [http://oftc.net OFTC] you will need to install their certificate:
 +
 
 +
# wget http://www.spi-inc.org/ca/spi-cacert.crt -O /etc/ca-certificates/trust-source/anchors/spi-cacert.crt
 +
# trust update-compat
 +
 
 +
== Tips and Tricks ==
 +
 
 +
=== Upgrading ===
  
===Upgrading===
 
 
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):
 
WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):
 +
 
  /upgrade
 
  /upgrade
 +
 
This will load the new WeeChat binary and reload the current configuration.
 
This will load the new WeeChat binary and reload the current configuration.
  
===Aliases===
+
=== Aliases ===
 +
 
 
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:
 
Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's '''smart filter''' alias:
  
'''Smart Filter'''<br>
+
'''Smart Filter'''
 +
 
 
First, we need to enable smart filters:
 
First, we need to enable smart filters:
 +
 
  /set irc.look.smart_filter "on"
 
  /set irc.look.smart_filter "on"
  
 
Next, we will create the '''sfilter''' alias:
 
Next, we will create the '''sfilter''' alias:
  /alias sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *
+
 
 +
  /alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *
 +
 
 
We can now type
 
We can now type
 +
 
  /sfilter
 
  /sfilter
 +
 
in any buffer, and the smart filter will only be enabled for that buffer.
 
in any buffer, and the smart filter will only be enabled for that buffer.
  
The following alias will remove a previously enabled smart filter in the current buffer:<br>
+
The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:
Add the alias:
+
 
  /alias rmsfilter filter del irc_smart_$server_$channel
+
  /alias add rmsfilter filter del irc_smart_$server_$channel
 +
 
 
and execute it by
 
and execute it by
 +
 
  /rmsfilter
 
  /rmsfilter
  
===Key Bindings===
+
=== Exec command ===
 +
A new plugin called "exec" has been added, with command {{ic|/exec}}. It will execute external command and can display output to the current buffer with the '''-o''' option or locally (default).
 +
 
 +
=== Key Bindings ===
 +
 
 
Some helpful bindings:
 
Some helpful bindings:
  
 
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:
 
To use ctrl-left/right arrow keys to jump to next/previous words on the input line:
 +
 
  /key bind meta2-1;5D /input move_previous_word
 
  /key bind meta2-1;5D /input move_previous_word
 
  /key bind meta2-1;5C /input move_next_word
 
  /key bind meta2-1;5C /input move_next_word
  
===SSH connection lost when idle===
+
=== SSH connection lost when idle ===
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnecting after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.
+
 
 +
If you're connecting to your WeeChat through a remote shell using SSH, for example running it in [[screen]] or [[tmux]] you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.
 +
 
 
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat.  
 
This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative [[irssi]] by default, and thus is a common situation for those converting to WeeChat.  
  
Line 115: Line 168:
 
ClientAliveInterval 300}}
 
ClientAliveInterval 300}}
  
Or just have a look at [http://mosh.mit.edu/ Mosh]
+
Or have a look at [http://mosh.mit.edu/ Mosh].
 +
 
 +
=== OTR ===
 +
 
 +
Install {{AUR|python2-potr}} and enable the script '''otr.py'''. Then:
 +
 
 +
/query <nick>
 +
/otr start
 +
 
 +
Get help on the plugin with:
 +
 
 +
/help otr
 +
 
 +
=== Slack ===
 +
 
 +
[https://slack.com/ Slack] is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.
 +
 
 +
==== IRC gateway ====
 +
 
 +
Once weechat is running, all you have to is add a new server this way:
 +
 
 +
{{ic|<nowiki>/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK</nowiki>}}
 +
 
 +
where:
 +
 
 +
* '''NAME''' is the name you want to give to the server
 +
* '''HOST''' is the the Host as provided on the Gateways page of your slack team
 +
* '''PASSWORD''' is the Pass as provided on the Gateways page of your slack team
 +
* '''USERNAME''' is the User as provided on the Gateways page of your slack team
 +
* '''NICK''' is your Slack username.
 +
 
 +
===== Upload file =====
 +
 
 +
To upload a file, run this following command from your shell :
 +
 
 +
{{ic|<nowiki>curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload</nowiki>}}
 +
 
 +
where:
 +
 
 +
* '''CHAN''' is the channel ID as provided on the Gateways page of your slack team
 +
* '''XXX''' is the team token as provided on the Gateways page of your slack team
 +
 
 +
==== Native client ====
 +
 
 +
There is a native client for slack: [https://github.com/rawdigits/wee-slack wee-slack]
 +
 
 +
You need to install the python2 librairy websocket-client:
 +
 
 +
{{ic|<nowiki>pacman -S python2-websocket-client</nowiki>}}
 +
 
 +
Then install the wee-chat plugin into the weechat configuration folder
 +
 
 +
{{ic|<nowiki>curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py</nowiki>}}
 +
 
 +
Run {{ic|<nowiki>/python reload</nowiki>}} to load the new plugin
 +
 
 +
You will need an access token. You can grab one at [https://api.slack.com/docs/oauth-test-tokens here]
 +
 
 +
Once weechat is running, register your token into weechat:
 +
 
 +
{{ic|<nowiki>/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]</nowiki>}}
 +
 
 +
And finally:
 +
 
 +
{{ic|<nowiki>/save</nowiki>}}
 +
 
 +
{{ic|<nowiki>/python reload</nowiki>}}
 +
 
 +
===== Upload file =====
 +
 
 +
To upload a file enter the following command into weechat:
 +
 
 +
{{ic|<nowiki>/slack upload [file_path]</nowiki>}}
 +
 
 +
=== Desktop notifications ===
 +
 
 +
To receive desktop notifications for mentions or private messages, the [https://github.com/s3rvac/weechat-notify-send weechat-notify-send] script by Petr Zemek can be used.
 +
 
 +
To install, use:
 +
 
 +
cd ~/.weechat/python
 +
curl -O <nowiki>https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py</nowiki>
 +
ln -s ../notify_send.py autoload/
 +
 
 +
The script uses {{Pkg|libnotify}} and is known to work with both KDE and Gnome.
 +
 
 +
=== Mobile device notifications ===
 +
 
 +
To receive notifications for mentions or private messages to an Android mobile device, you can use the [https://irssinotifier.appspot.com/ IrssiNotifier] port to WeeChat from [http://www.weechat.org/files/scripts/irssinotifier.py here]. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin
 +
 
 +
cd ~/.weechat/python
 +
curl -O <nowiki>http://www.weechat.org/files/scripts/irssinotifier.py</nowiki>
 +
ln -s ../irssinotifier.py autoload/
 +
 
 +
and intialize the API token and end-to-end encryption password in WeeChat
 +
 
 +
/set plugins.var.python.irssinotifier.api_token your-api-token-from-website
 +
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app
 +
/save
 +
 
 +
An alternative that does not require a Google Account is a Ruby script for [http://www.notifymyandroid.com NotifyMyAndroid.com] from [https://github.com/jamtur01/nma-weechat here], with a similar installation procedure to the above, but into {{ic|~/.weechat/ruby}}.
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Errors loading plugins ===
 +
 
 +
You may see output like the following in the main window after starting '''weechat''':
 +
 
 +
12:29:37 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/'''tcl.so'''": libtcl8.6.so: cannot open shared object file: No such file or directory
 +
12:29:37 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
 +
12:29:37 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/'''ruby.so'''": libruby.so.2.0: cannot open shared object file: No such file or directory
 +
12:29:37 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
 +
12:29:37    | Plugins loaded: alias, aspell, charset, fifo, guile, irc, logger, lua, perl, python, relay, rmodifier, script, xfer
 +
 
 +
The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes both tcl and ruby. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:
 +
 
 +
# [[Packages|Install]] [https://www.archlinux.org/packages/?name=tcl tcl], [https://www.archlinux.org/packages/?name=ruby ruby] from the [[official repositories]].
 +
# Or, run {{ic|/set weechat.plugin.autoload "*,!tcl,!ruby"}} which will prevent loading those plugins with a bang (!) prefix.
 +
 
 +
== Getting Help ==
  
==Getting Help==
 
 
To access WeeChat's built-in help, simply type
 
To access WeeChat's built-in help, simply type
 +
 
  /help
 
  /help
 +
 
and the help will be displayed in the main buffer (usually buffer 1).
 
and the help will be displayed in the main buffer (usually buffer 1).
  
==External Links==
+
== See also ==
[http://www.weechat.org WeeChat Home Page] <br />
+
 
[http://www.weechat.org/doc/ WeeChat Documentation] <br />
+
* [http://www.weechat.org Home Page]
[http://www.weechat.org/scripts/ WeeChat Scripts] <br />
+
* [http://www.weechat.org/doc/ WeeChat Documentation]
[http://dev.weechat.org/ WeeChat Development Blog]
+
* [http://www.weechat.org/scripts/ WeeChat Scripts]
 +
* [http://dev.weechat.org/ WeeChat Development Blog]
 +
 
 +
=== Guides ===
  
==Guides==
+
* [http://fixato.org/guides/setting_up_weechat.html FiXato's guide to WeeChat]
[http://fixato.org/guides/setting_up_weechat.html FiXato's guide to WeeChat]
+
* [http://pascalpoitras.com/2013/06/29/weechat-my-favorites-scripts/ Pascalpoitras: Favorite scripts]
[http://pascalpoitras.com/ Pascalpoitras Weechat Tips]
+
* [http://pascalpoitras.com/ Pascalpoitras Weechat Tips]
 +
* [http://robots.thoughtbot.com/weechat-for-slacks-irc-gateway Thoughtbot article on weechat and slack]

Latest revision as of 03:49, 4 May 2016

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: See Help:Style and related. (Discuss in Talk:WeeChat#)

Related articles

WeeChat is a highly extendable and feature rich IRC Client currently under heavy development.

Installing

Install weechat from the official repositories. The development version weechat-gitAUR is available in the AUR.

Running WeeChat

WeeChat is going to have multiple interfaces at some point, run weechat-[interface] to start WeeChat.

As WeeChat currently only has an Ncurses interface. The command to start WeeChat is:

$ weechat

Configuration

You can configure WeeChat in 3 ways: using WeeChat's internal commands; using iset; or by editing the .conf files directly. WeeChat will automatically save settings on exit or when you run /save, so if you are editing a .conf file in an editor, be sure to run /reload from the console before exiting, otherwise your changes will be lost.

Internal commands

The /set command follows this structure: /set [file.name].[section].[directive]

You can get a list of all configurable options by typing /set in the weechat buffer window. Since there are nearly 600 default configurable options, you can search through them with a wildcard syntax: /set irc.server.* or /set *server* as an example. You can get help on each option with the /help command:

/help irc.server.freenode.autoconnect

Internal menu-based

For a more convenient method, install the iset script. If you have weechat 0.3.9 or newer, run:

/script install iset.pl

In older versions, use /weeget install iset, or download iset.pl into your ~/.weechat/perl/autoload directory manually.

Afterwards, run

/iset

to get a buffer with all configuration options.

Configuration Files

The .conf files for WeeChat are saved to ~/.weechat. These files are not commented. Detailed information can be found within the program itself (see Internally above), or WeeChat's user guide.

Tip: in case you want to move .weechat directory somewhere else (like in your '$XDG_CONFIG_HOME), use this option : $weechat -d $XDG_CONFIG_HOME/weechat

Connecting to a server

Note: Using /connect to connect to a temporary server is disabled by default if you're using 1.1+ Release Note

Enable by /set irc.look.temporary_servers on

You can connect to a IRC server by using /connect.

/connect chat.freenode.net

Or if there is already a Server setup you can use:

/connect freenode

Creating a Server profile

If you plan on connecting to a server more than once it may be beneficial to create a Server.

/server add example irc.example.net/6667

Would create the server example which would connect to irc.example.net on port 6667

See the WeeChat documentation and /help server for more information.

Configuring SSL

Many IRC servers, including freenode where #archlinux is, support SSL.

If you're making a server with /server, add the SSL port (usually 6697) and -ssl to the end of the line. For example:

/server add freenode chat.freenode.net/6697 -ssl

You can do the same thing if using /connect.

/connect chat.freenode.net/6697 -ssl
Warning: Some servers need the ssl_dhkey_size value changed to something lower. For example, if you're using freenode you'll need to set /set irc.server.freenode.ssl_dhkey_size 1024 or /set irc.server.chat.freenode.net.ssl_dhkey_size 1024 (see the server log)
Note: Different servers may have a different port than 6697 - this is server specific.

You may also want to change the location where WeeChat looks for trusted authorities (the default value is %h/ssl/CAs.pem which translates to ~/.weechat/ssl/CAs.pem):

/set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"

OFTC

If you wish to connect to OFTC you will need to install their certificate:

# wget http://www.spi-inc.org/ca/spi-cacert.crt -O /etc/ca-certificates/trust-source/anchors/spi-cacert.crt
# trust update-compat

Tips and Tricks

Upgrading

WeeChat can be upgraded without disconnecting from the IRC servers (non-SSL connections only):

/upgrade

This will load the new WeeChat binary and reload the current configuration.

Aliases

Aliases can be created to simplify commonly executed commands. A nice example is Wraithan's smart filter alias:

Smart Filter

First, we need to enable smart filters:

/set irc.look.smart_filter "on"

Next, we will create the sfilter alias:

/alias add sfilter filter add irc_smart_$server_$channel irc.$server.$channel irc_smart_filter *

We can now type

/sfilter

in any buffer, and the smart filter will only be enabled for that buffer.

The following alias will remove a previously enabled smart filter in the current buffer. Add the alias:

/alias add rmsfilter filter del irc_smart_$server_$channel

and execute it by

/rmsfilter

Exec command

A new plugin called "exec" has been added, with command /exec. It will execute external command and can display output to the current buffer with the -o option or locally (default).

Key Bindings

Some helpful bindings:

To use ctrl-left/right arrow keys to jump to next/previous words on the input line:

/key bind meta2-1;5D /input move_previous_word
/key bind meta2-1;5C /input move_next_word

SSH connection lost when idle

If you're connecting to your WeeChat through a remote shell using SSH, for example running it in screen or tmux you might experience getting disconnected after a while when idle. There are multiple factors in play why this might happen, but the easiest way to change this is to force the connection to be kept alive by appending this to your SSH-configuration on the remote shell.

This has nothing to do with WeeChat itself, but losing connection when idle won't happen with it's alternative irssi by default, and thus is a common situation for those converting to WeeChat.

# /etc/ssh/sshd_config
ClientAliveInterval 300

Or have a look at Mosh.

OTR

Install python2-potrAUR and enable the script otr.py. Then:

/query <nick>
/otr start

Get help on the plugin with:

/help otr

Slack

Slack is a platform for team communication; an IRC on steroids. Thanks to its open API, it is possible to connect to your slack team using weechat.

IRC gateway

Once weechat is running, all you have to is add a new server this way:

/server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK

where:

  • NAME is the name you want to give to the server
  • HOST is the the Host as provided on the Gateways page of your slack team
  • PASSWORD is the Pass as provided on the Gateways page of your slack team
  • USERNAME is the User as provided on the Gateways page of your slack team
  • NICK is your Slack username.
Upload file

To upload a file, run this following command from your shell :

curl -F file=@/path/to/file -F channels=CHAN -F token=XXX https://slack.com/api/files.upload

where:

  • CHAN is the channel ID as provided on the Gateways page of your slack team
  • XXX is the team token as provided on the Gateways page of your slack team

Native client

There is a native client for slack: wee-slack

You need to install the python2 librairy websocket-client:

pacman -S python2-websocket-client

Then install the wee-chat plugin into the weechat configuration folder

curl -o ~/.weechat/python/autoload/wee_slack.py https://raw.githubusercontent.com/rawdigits/wee-slack/master/wee_slack.py

Run /python reload to load the new plugin

You will need an access token. You can grab one at here

Once weechat is running, register your token into weechat:

/set plugins.var.python.slack_extension.slack_api_token [YOUR_SLACK_TOKEN]

And finally:

/save

/python reload

Upload file

To upload a file enter the following command into weechat:

/slack upload [file_path]

Desktop notifications

To receive desktop notifications for mentions or private messages, the weechat-notify-send script by Petr Zemek can be used.

To install, use:

cd ~/.weechat/python
curl -O https://raw.githubusercontent.com/s3rvac/weechat-notify-send/master/notify_send.py
ln -s ../notify_send.py autoload/

The script uses libnotify and is known to work with both KDE and Gnome.

Mobile device notifications

To receive notifications for mentions or private messages to an Android mobile device, you can use the IrssiNotifier port to WeeChat from here. This script requires a Google Account, and a registration step with the service provider to obtain an API key. Then, install the plugin

cd ~/.weechat/python
curl -O http://www.weechat.org/files/scripts/irssinotifier.py
ln -s ../irssinotifier.py autoload/

and intialize the API token and end-to-end encryption password in WeeChat

/set plugins.var.python.irssinotifier.api_token your-api-token-from-website
/set plugins.var.python.irssinotifier.encryption_password your-password-same-as-in-andoid-app
/save

An alternative that does not require a Google Account is a Ruby script for NotifyMyAndroid.com from here, with a similar installation procedure to the above, but into ~/.weechat/ruby.

Troubleshooting

Errors loading plugins

You may see output like the following in the main window after starting weechat:

12:29:37 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory
12:29:37 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
12:29:37 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.0: cannot open shared object file: No such file or directory
12:29:37 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
12:29:37     | Plugins loaded: alias, aspell, charset, fifo, guile, irc, logger, lua, perl, python, relay, rmodifier, script, xfer

The default configuration for weechat attempts to load all plugins found in /usr/lib/weechat/plugins which in this case includes both tcl and ruby. These packages are not required by the weechat package and may not be installed on your machine. There are two options if these errors bother you:

  1. Install tcl, ruby from the official repositories.
  2. Or, run /set weechat.plugin.autoload "*,!tcl,!ruby" which will prevent loading those plugins with a bang (!) prefix.

Getting Help

To access WeeChat's built-in help, simply type

/help

and the help will be displayed in the main buffer (usually buffer 1).

See also

Guides