WeeChat

提供: ArchWiki
2023年11月16日 (木) 06:37時点におけるKgx (トーク | 投稿記録)による版 (→‎サーバーに接続: 情報を更新)
ナビゲーションに移動 検索に移動

関連記事

WeeChat は高い拡張性を誇る機能豊富な IRC クライアントです。現在も活発に開発されています。

インストール

公式リポジトリから weechatインストールしてください。開発版は AURweechat-gitAUR でインストールできます。

実行

WeeChat は複数のインターフェイスを備えられるようになっています。weechat-[interface] を実行して WeeChat を起動してください。

現在のところ WeeChat には Ncurses インターフェイスしかありません。WeeChat の起動コマンドは:

$ weechat

設定

デフォルトでは、WeeChat は設定ファイルを XDG directory に保存します。WeeChat はいつでもファイルを書き込む可能性があるため、これらのファイルを直接編集することはお勧めできません。[1]

代わりに、/set コマンド を使用する必要があります。WeeChat バッファウィンドウで /set を実行すると、設定可能なすべてのオプションのリストを取得できます。デフォルトの設定可能なオプションは 600 近くあるため、ワイルドカード構文 (例として /set irc.server.* または /set *server*) を使用して検索できます。/help コマンドを使用すると、各オプションのヘルプを表示できます。

/help irc.server.libera.autoconnect
ヒント: すべての設定ファイルを単一のディレクトリに置きたい場合 (~/.weechat など)、このオプションを使用します: $ weechat -d $HOME/.weechat または環境変数 WEECHAT_HOME

サーバーに接続

IRC サーバーに接続するには、サーバーを追加してから /connect を使用します:

/server add libera irc.libera.chat/6697
/connect libera

詳細については、WeeChat のドキュメントと /help server を参照してください。

ノート: 事前にサーバーを追加せずに、/connect を使用した一時的なサーバー接続は許可されません。この機能を有効にするには、最初に /set irc.look.temporary_servers on を使用します。

サーバープロファイルの作成

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.

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
警告: 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)
ノート: 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"

ヒントとテクニック‎

アップグレード

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 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 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 rmsfilter filter del irc_smart_$server_$channel

and execute it by

/rmsfilter

Exec コマンド

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).

キーバインド

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 の接続が切れる

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.

Slack IRC ゲートウェイ

Slack is a platform for team communication, a IRC on steroïd. Thanks to its open API, it is possible to connect to your slack team using weechat.

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.

ファイルのアップロード

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

トラブルシューティング

プラグインのロードエラー

weechat を開始すると、メイン ウィンドウに次のような出力が表示される場合があります:

13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/ruby.so": libruby.so.2.4: cannot open shared object file: No such file or directory
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/lua.so": liblua.so.5.3: cannot open shared object file: No such file or directory
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/aspell.so": libaspell.so.15: cannot open shared object file: No such file or directory
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
13:26:10 =!= | Error: unable to load plugin "/usr/lib/weechat/plugins/tcl.so": libtcl8.6.so: cannot open shared object file: No such file or directory
13:26:10 =!= | If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)

weechat のデフォルト設定では、/usr/lib/weechat/plugins にあるすべてのプラグインをロードしようとします。この場合、ruby、lua、aspell、tcl が含まれます。これらのパッケージは weechat パッケージには必要ないため、マシンにインストールできない場合があります。これらのエラーが気になる場合は、次の 2 つのオプションがあります。

  1. rubyluaaspell、および/または tclインストール
  2. または、/set weechat.plugin.autoload "*,!ruby,!lua,!aspell,!tcl" を実行すると、(!) プレフィックスが付いたプラグインがロードされなくなります。

multiline.pl の読み込み中に問題が発生しました

この問題は、perl バージョン 5.31.1 以上で発生します。

multiline.pl スクリプトは、Pod::Select モジュールに依存します。ただし、perl バージョン v5.31.1 以降、Pod::Select は削除されました。

この問題を解決するには、perl-pod-parser をインストールします。

ヘルプの表示

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

/help

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

参照

ガイド