「WeeChat」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
101行目: 101行目:
   
 
=== Exec コマンド ===
 
=== Exec コマンド ===
  +
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).
 
  +
"exec" という新しいプラグインが追加され、コマンドは {{ic|/exec}} です。外部コマンドを実行し、{{ic|-o}} オプションを使用して現在のバッファに出力を表示することも、ローカル (デフォルト) で出力を表示することもできます。
   
 
=== キーバインド ===
 
=== キーバインド ===

2023年11月16日 (木) 18:41時点における版

関連記事

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 の設定

libera (#archlinux を含む) を含む多くの IRC サーバーは SSL をサポートしています。

/server でサーバーを作成している場合は、SSL ポート (通常は 6697) と -tls を行の最後に追加します。例えば:

/server add libera irc.libera.chat/6697 -tls
ノート: 一部のサーバーでは、ssl_dhkey_size の値をより低い値に変更する必要があります。たとえば、Libera を使用している場合は、コマンド /set irc.server.libera.tls_dhkey_size 1024 または /set irc.server.libera.tls_dhkey_size 1024 コマンドで値を設定する必要があります。(サーバーログを参照)

ヒントとテクニック‎

アップグレード

WeeChat は、IRC サーバーから切断せずにアップグレードできます (非 SSL 接続のみ):

/upgrade

これにより、新しい WeeChat バイナリがロードされ、現在の設定が再ロードされます。

エイリアス

エイリアスを作成して、一般的に実行されるコマンドを簡素化できます。良い例は、Wraithan の Smart Filter エイリアスです。

Smart Filter

まず、Smart Filter を有効にする必要があります。

/set irc.look.smart_filter "on"

次に、sfilter エイリアスを作成します。

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

入力できるようになりました

/sfilter

任意のバッファにある場合、Smart Filter はそのバッファに対してのみ有効になります。

次のエイリアスは、現在のバッファーで以前に有効化された Smart Filter を削除する。エイリアスを追加します:

/alias rmsfilter filter del irc_smart_$server_$channel

実行

/rmsfilter

Exec コマンド

"exec" という新しいプラグインが追加され、コマンドは /exec です。外部コマンドを実行し、-o オプションを使用して現在のバッファに出力を表示することも、ローカル (デフォルト) で出力を表示することもできます。

キーバインド

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

参照

ガイド