「Rxvt-unicode/ヒントとテクニック」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(同期)
 
(4人の利用者による、間の18版が非表示)
44行目: 44行目:
 
</nowiki>}}
 
</nowiki>}}
   
  +
上記で保存した {{ic|urxvtc}} を {{ic|/path/to/urxvtc}} スクリプトレットへの実際のパスに変更することを確認してください。{{ic|urxvt}} の通常のインスタンスと kuake のようなインスタンスの両方を起動するために {{ic|urxvtc}} を使用する予定です。
Make sure that you change {{Ic|/path/to/urxvtc}} to the actual path to the {{ic|urxvtc}} scriptlet that you saved above. We will be using {{ic|urxvtc}} to launch both regular instances of {{Ic|urxvt}} and the kuake-like instance.
 
   
 
=== urxvtq とタブ ===
 
=== urxvtq とタブ ===
   
If you want to have tabs in your kuake-like {{ic|urxvtc}} (here called {{ic|urxvtq}}) just replace the third line in your {{ic|urxvtq}}:
+
kuake-like {{ic|urxvtc}} (ここでは {{ic|urxvtq}}) でタブを使いたい場合は、 {{ic|urxvtq}} の3行目を置き換えるだけでよいです。
wid=$(xdotool search --name urxvtq)
+
wid=$(xdotool search --classname urxvtq)
  +
一緒に:
with:
 
wid=$(xdotool search --name urxvtq | grep -m 1 "" )
+
wid=$(xdotool search --classname urxvtq | grep -m 1 "" )
   
  +
タブサポートを有効にするには、{{ic|urxvtq}} の5行目を置き換えるかのどちらかです。
To activate tab support, you can either replace the fifth line of your {{ic|urxvtq}}:
 
 
/path/to/urxvtc -name urxvtq -geometry 80x28
 
/path/to/urxvtc -name urxvtq -geometry 80x28
  +
一緒に:
with:
 
 
/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28
 
/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28
or replace this line of your {{ic|~/.Xresources}} file:
+
または、{{ic|~/.Xresources}} ファイルのこの行を置き換えます。
 
URxvt.perl-ext-common: default,matcher
 
URxvt.perl-ext-common: default,matcher
  +
一緒に:
with
 
 
URxvt.perl-ext-common: default,matcher,tabbed
 
URxvt.perl-ext-common: default,matcher,tabbed
   
74行目: 74行目:
 
|}
 
|}
   
  +
また、マウスで希望のタブをクリックして切り替えることもできますし、''[NEW].\\'' をクリックすれば新しいタブを作ることもできます。
You can also use your mouse to switch the tabs by clicking the wished one and create a new tab by clicking on ''[NEW].\\''
 
   
  +
タブを閉じるには、通常の端末を閉じるのと同じように {{Ic|exit}} を入力するだけです。
To close a tab just enter {{Ic|exit}} like you would to normally close a terminal.
 
   
 
=== Openbox の設定 ===
 
=== Openbox の設定 ===
97行目: 97行目:
 
}}
 
}}
   
and add these lines to the {{Ic|<keyboard>}} section:
+
そして、次の行を {{Ic|<keyboard>}} セクションに追加します。
   
 
{{bc|1=
 
{{bc|1=
112行目: 112行目:
 
}}
 
}}
   
  +
ここでも、{{ic|/path/to/*}} の行を、上記で保存したスクリプトを指すように変更する必要があります。ファイルを保存して、Openbox を再設定します。これで、通常の urxvt インスタンスを {{ic|Super+T}} で起動し、kuake 風コンソールを {{ic|Super+''`''}} で切り替えられるようになったはずです。(grave key、backtick とも呼ばれる)
Here too you need to change the {{Ic|/path/to/*}} lines to point to the scripts that you saved above. Save the file and then reconfigure Openbox. You should now be able to launch regular instances of urxvt with {{ic|Super+T}}, and toggle the kuake-like console with {{ic|Super+'''`'''}} (the grave key also known as the backtick).
 
   
 
=== 他の設定 ===
 
=== 他の設定 ===
   
The advantage of this configuration over the urxvt kuake Perl script is that Openbox provides more keybinding options such as modifier keys. The kuake script hijacks an entire physical key regardless of any modifier combination. Review the [http://openbox.org/wiki/Help:Bindings Openbox bindings documentation] for the full range or possibilities.
+
この設定が urxvt kuake Perl スクリプトより優れている点は、Openbox が修飾キーなど、より多くのキーバインドオプションを提供していることです。kuake スクリプトは、修飾キーの組み合わせに関係なく、物理キー全体をハイジャックします。すべての可能性については、[http://openbox.org/wiki/Help:Bindings Openbox bindings documentation] を参照してください。
   
The [http://openbox.org/wiki/Help:Applications Openbox per-app settings] can be used to further configure the behavior of the kuake-like console (e.g. screen position, layer, etc.). You may need to change the "geometry" parameter in the {{ic|urxvtq}} scriptlet to adjust the height of the console.
+
[http://openbox.org/wiki/Help:Applications Openbox per-app settings] を使って、kuake-like console の動作(画面位置やレイヤーなど)をさらに設定することができます。コンソールの高さを調整するために {{ic|urxvtq}} スクリプトレットで ''geometry'' パラメータを変更する必要があるかもしれません。
   
 
=== 関連スクリプト ===
 
=== 関連スクリプト ===
   
* hbekel has posted a generalized version of the {{ic|urxvtq}} [https://bbs.archlinux.org/viewtopic.php?pid=550380#p550380 here] which can be used to toggle any application using {{Pkg|xdotool}}.
+
* hbekel {{ic|urxvtq}} を一般化したものを投稿しました。{{Pkg|xdotool}} を使って任意のアプリケーションをトグルできます [https://bbs.archlinux.org/viewtopic.php?pid=550380#p550380 ここ]
* http://www.jukie.net/~bart/blog/20070503013555 - A script for opening URLs with your keyboard instead of mouse with urxvt.
+
* http://www.jukie.net/~bart/blog/20070503013555 - マウスではなくキーボードで URL を開くためのスクリプトです。
   
 
== パフォーマンスの改善 ==
 
== パフォーマンスの改善 ==
   
* Xft フォントは使わないでください。どうしても Xft フォントを使う必要がある場合、設定値に {{Ic|<nowiki>:antialias=false</nowiki>}} を追加してください [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_speed_up_Xft_rendering_somehow]
+
* Xft フォントは使わないでください。どうしても Xft フォントを使う必要がある場合、設定値に {{Ic|<nowiki>:antialias=false</nowiki>}} を追加してください [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_speed_up_Xft_rendering_somehow]
* Build rxvt-unicode with disabled support for unnecessary features, {{Ic|--disable-xft}} and {{Ic|--disable-unicode3}} in particular.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Rxvt_unicode_uses_gobs_of_memory_how]
+
* 特に {{Ic|--disable-xft}} {{Ic|--disable-unicode3}} は、不要な機能のサポートを無効にして rxvt-unicode を構築します。<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Rxvt_unicode_uses_gobs_of_memory_how]
* Limit the number of {{Ic|saveLines}} (option {{Ic|-sl}}) in the scrollback buffer to reduce memory usage. [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Isn_t_rxvt_unicode_supposed_to_be_sm]
+
* メモリ使用量を減らすために、スクロールバックバッファ内の {{Ic|saveLines}} (オプション {{Ic|-sl}}) の数を制限します。[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Isn_t_rxvt_unicode_supused_to_be_sm]
  +
** スクロールバックバッファーは tmux を使用し、saveLines を 0 に設定します。
** Use tmux for scrollback buffer and set saveLines to 0
 
* [[rxvt-unicode#Perl 拡張の無効化|perl の無効化]]
+
* [[rxvt-unicode#Perl 拡張の無効化|Perlの無効化]]
  +
* {{ic|urxvtd}} を {{Ic|urxvtc}} クライアントからの接続を受け入れるデーモンとして実行することを検討してください。
* Consider running {{Ic|urxvtd}} as a daemon accepting connections from {{Ic|urxvtc}} clients.
 
   
 
=== デーモンクライアント ===
 
=== デーモンクライアント ===
196行目: 196行目:
 
URxvt.perl-ext-common: ...,tabbedex,...
 
URxvt.perl-ext-common: ...,tabbedex,...
   
{{Note|If you have previously used the {{ic|tabbed}} Perl extension and have defined the {{ic|tabbed}} value for the {{ic|URxvt.perl-ext-common}} X resource, please remove the {{ic|tabbed}} value first to avoid conflict with {{ic|tabbedex}}.}}
+
{{Note|以前に{{ic|tabbed}} を使用したことがある場合 Perl 拡張機能で {{ic|tabbed}} の値を {{ic|URxvt.perl-ext-common}} に定義している場合。X リソースとの衝突を避けるために、まず {{ic|tabbedex}} の値を削除してください。}}
  +
  +
"[NEW]" ボタン (めったに使用されず、マウスでのみ使用可能) は、tabbedex のデフォルトでは無効になっています。この機能を再び有効にするには、{{ic|new-button}} を true に設定します。
   
By default, the "[NEW]" button (which is rarely used and usable only with the mouse) is disabled with tabbedex. You can reenable this feature by setting the {{ic|new-button}} to yes.
 
 
URxvt.tabbed.new-button: true
 
URxvt.tabbed.new-button: true
   
Tabs can be named with {{ic|Shift+ ↑}} ({{ic|Enter}} to confirm, {{ic|Escape}} to cancel).
+
タブの名前は {{ic|Shift+ ↑}} ({{ic|Enter}} で確定、{{ic|Escape}} で取り消し) で付けることができます。
   
  +
タブが1つしかないときにタブバーを自動的に隠すには、次のリソースを有効にします。
To automatically hide the tabs bar when only one tab is present, enable the following resource:
 
 
URxvt.tabbed.autohide: true
 
URxvt.tabbed.autohide: true
   
  +
最後のタブで Urxvt を閉じないようにするには、以下のリソースを有効にします。
To prevent the last tab from closing Urxvt, enable the following resource:
 
 
URxvt.tabbed.reopen-on-close: yes
 
URxvt.tabbed.reopen-on-close: yes
   
To start a new tab or cycle through tabs, use the following user commands: {{ic|<nowiki>tabbedex:(new|next|prev)_tab</nowiki>}}. Example of mappings:
+
新しいタブを開始したり、タブを循環させるには、次のユーザーコマンドを使用します。{{ic|<nowiki>tabbedex:(new|next|prev)_tab</nowiki>}} を使用します。マッピングの例
 
URxvt.keysym.Control-t: perl:tabbedex:new_tab
 
URxvt.keysym.Control-t: perl:tabbedex:new_tab
 
URxvt.keysym.Control-Tab: perl:tabbedex:next_tab
 
URxvt.keysym.Control-Tab: perl:tabbedex:next_tab
 
URxvt.keysym.Control-Shift-Tab: perl:tabbedex:prev_tab
 
URxvt.keysym.Control-Shift-Tab: perl:tabbedex:prev_tab
   
To define your own key bindings to rename a tab or move a tab to the right or to the left, use the following commands: {{ic|<nowiki>tabbedex:move_tab_(left|right)</nowiki>}} and {{ic|tabbedex:rename_tab}}. Example of mappings:
+
タブの名前を変更したり、タブを右や左に移動したりするキーバインドを独自に定義するには、以下のコマンドを使用します。{{ic|<nowiki>tabbedex:move_tab_(left|right)</nowiki>}} {{ic|tabbedex:rename_tab}} を使ってください。マッピングの例
 
URxvt.keysym.Control-Shift-Left: perl:tabbedex:move_tab_left
 
URxvt.keysym.Control-Shift-Left: perl:tabbedex:move_tab_left
 
URxvt.keysym.Control-Shift-Right: perl:tabbedex:move_tab_right
 
URxvt.keysym.Control-Shift-Right: perl:tabbedex:move_tab_right
 
URxvt.keysym.Control-Shift-R: perl:tabbedex:rename_tab
 
URxvt.keysym.Control-Shift-R: perl:tabbedex:rename_tab
   
  +
{{Note|ユーザーコマンドに使われるキーを再定義してもデフォルトのマッピングは無効にならないので、そのためには X リソース {{ic|no-tabbedex-keys}} を設定しなければなりません。しかし、現在このリソースは {{AUR|urxvt-tabbedex}} パッケージに含まれていません。代わりに {{AUR|urxvt-tabbedex-git}} パッケージを使うことを検討してください。
{{Note|Redefining the keys used for the user commands will not disable the default mappings, you have to set the X resource {{ic|no-tabbedex-keys}} for that. However, currently it is not included in {{AUR|urxvt-tabbedex}} package. Consider using {{AUR|urxvt-tabbedex-git}} package instead:
 
 
URxvt.tabbed.no-tabbedex-keys: true
 
URxvt.tabbed.no-tabbedex-keys: true
 
}}
 
}}
249行目: 250行目:
 
'95' は透過レベル (パーセンテージ)、'#000000' は背景色に置き換えて下さい。
 
'95' は透過レベル (パーセンテージ)、'#000000' は背景色に置き換えて下さい。
   
To use a color i.e. #302351 with the rgba:rrrr/gggg/bbbb/aaaa syntax it would be rgba:3000/2300/5100/ee00. "ee00" (the alpha value) to make it nicely transparent.
+
302351 という色を rgba:rrr/gggg/bbb/aa 構文で使う場合は、rgba:3000/2300/5100/ee00 となります。''ee00"(アルファ値)を指定すると、きれいに透明になります。
   
{{Note|To make these settings universal for all forms of URxvt, you may add a wildcard. For example, {{ic|URxvt.depth}} would become {{ic|URxvt*depth}}.}}
+
{{Note|これらの設定を URxvt のすべての形式に対して普遍化するために、ワイルドカードを追加することができます。例えば、 {{ic|URxvt.depth}} {{ic|URxvt*depth}} になります。}}
   
 
=== 疑似透過 ===
 
=== 疑似透過 ===
268行目: 269行目:
 
上記の URxvt*.shading の代わりに URxvt*background を使うこともできます。
 
上記の URxvt*.shading の代わりに URxvt*background を使うこともできます。
   
{{Note|Avoid using shading if you have a {{ic|URxvt.tintColor}} set. Use a different {{ic|tintColor}} instead.}}
+
{{Note|{{ic|URxvt.tintColor}} が設定されている場合は、シェーディングの使用は避けてください。代わりに別の {{ic|tintColor}} を使用してください。}}
   
 
== アイコンの設定 ==
 
== アイコンの設定 ==
   
{{Note|Because of a bug report ({{Bug|34862}}) complaining that the rxvt-unicode package had too many dependencies, you must now install the AUR package {{AUR|rxvt-unicode-pixbuf}} in order to use the icon option.}}
+
{{Note|rxvt-unicode パッケージの依存関係が多すぎるというバグレポート ({{Bug|34862}}) のため、icon オプションを使うには AUR パッケージ {{AUR|rxvt-unicode-pixbuf}} をインストールする必要があります。}}
   
  +
デフォルトでは URxvt にはタスクバーアイコンがありません。{{ic|~/.Xresources}} に以下の行を追加してアイコンを指定することで簡単に変更することができます:
By default URxvt does not feature a taskbar icon. However, this can be easily changed by adding the following line to {{ic|~/.Xresources}} and pointing to the desired icon:
 
   
 
URxvt.iconFile: /usr/share/icons/Clarity/scalable/apps/terminal.svg
 
URxvt.iconFile: /usr/share/icons/Clarity/scalable/apps/terminal.svg
300行目: 301行目:
 
== 双方向言語のサポート ==
 
== 双方向言語のサポート ==
   
ヘブライ語やアラビア語などの双方向言語のサポートは拡張で追加できます: {{AUR|urxvt-bidi}}
+
[https://metacpan.org/pod/distribution/Text-Bidi/misc/bidi bidi extension] を使用して、ヘブライ語やアラビア語などの双方向言語のサポート追加することができます。
   
  +
{{Note|使用するフォントはその言語をサポートするものでなければなりません。例えば、ヘブライ語を表示するには、terminus のようなフォントを使用する必要があります。}}
After installing it use it by either adding to your [[Xresources]] file:
 
URxvt.perl-ext: [other extensions],bidi
 
URxvt.bidi.enabled: 1
 
Or run urxvt as follows:
 
urxvt -pe bidi
 
 
{{Note|The font you're using should support your language. For example, for viewing Hebrew you should a font like terminus.}}
 
   
 
== ベルコマンド ==
 
== ベルコマンド ==
   
  +
ターミナルでベルが鳴ったときにシェルコマンドを実行することができます。最初に {{ic|~/.Xresources}} ファイルで {{ic|bell-command}} 拡張を有効にしてください:
It is possible to execute a shell command when the terminal rings the bell. The pre-packed {{ic|bell-command}} extension needs to be enabled first in the {{ic|~/.Xresources}} file:
 
  +
  +
URxvt.perl-ext-common: ...,bell-command,...
  +
  +
以下の例は [[ALSA]] の {{ic|aplay}} コマンドを使って {{ic|.wav}} ファイルを再生します:
   
  +
URxvt.bell-command: aplay /path/to/a/file.wav
URxvt.perl-ext-common: ...,bell-command,...
 
   
  +
次の例では、[[libcanberra]] の {{ic|canberra-gtk-play}} コマンドを使って、現在のサウンドテーマのベル音を再生しています。
The following example will use [[ALSA]]'s {{ic|aplay}} command to play a {{ic|.wav}} file:
 
   
URxvt.bell-command: aplay /path/to/a/file.wav
+
URxvt.bell-command: canberra-gtk-play -i bell
   
  +
そして次の設定により、視覚的な通知がポップアップします。
And the next setting will pop a visual notification:
 
   
URxvt.bell-command: notify-send "rxvt-unicode: bell!"
+
URxvt.bell-command: notify-send "rxvt-unicode: bell!"
   
 
{{note|{{ic|bell-command}} オプションだけ設定してもコンピュータのブザー音は無効になりません。[[PC スピーカー]]の記事を見てください。}}
 
{{note|{{ic|bell-command}} オプションだけ設定してもコンピュータのブザー音は無効になりません。[[PC スピーカー]]の記事を見てください。}}

2023年6月1日 (木) 17:23時点における最新版

メインの記事は rxvt-unicode を見てください。

Openbox で Kuake ライクな挙動を改善する

以下は元は Xyne によってフォーラムに投稿されたもの [1] で、公式リポジトリにある xdotool に依存しています。

スクリプトレット

urxvtc の man ページにある以下のスクリプトレットをシステム上 (例: ~/.config/openbox) に urxvtc と保存してください:

#!/bin/sh

urxvtc "$@"
if [ $? -eq 2 ]; then
   urxvtd -q -o -f
   urxvtc "$@"
fi

そして以下を urxvtq と保存してください:

#!/bin/bash

wid=$(xdotool search --classname urxvtq)
if [ -z "$wid" ]; then
  /path/to/urxvtc -name urxvtq -geometry 80x28
  wid=$(xdotool search --classname urxvtq | head -1)
  xdotool windowfocus "$wid"
  xdotool key Control_L+l
else
  if [ -z "$(xdotool search --onlyvisible --classname urxvtq 2>/dev/null)" ]; then
    xdotool windowmap "$wid"
    xdotool windowfocus "$wid"
  else
    xdotool windowunmap "$wid"
  fi
fi

上記で保存した urxvtc/path/to/urxvtc スクリプトレットへの実際のパスに変更することを確認してください。urxvt の通常のインスタンスと kuake のようなインスタンスの両方を起動するために urxvtc を使用する予定です。

urxvtq とタブ

kuake-like urxvtc (ここでは urxvtq) でタブを使いたい場合は、 urxvtq の3行目を置き換えるだけでよいです。

wid=$(xdotool search --classname urxvtq)

一緒に:

wid=$(xdotool search --classname urxvtq | grep -m 1 "" )

タブサポートを有効にするには、urxvtq の5行目を置き換えるかのどちらかです。

/path/to/urxvtc -name urxvtq -geometry 80x28

一緒に:

/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28

または、~/.Xresources ファイルのこの行を置き換えます。

URxvt.perl-ext-common: default,matcher

一緒に:

URxvt.perl-ext-common: default,matcher,tabbed

タブの操作

キー 説明
Shift+Left 左側のタブに切り替える。
Shift+Right 右側のタブに切り替える。
Shift+Down 新しいタブを作成。

また、マウスで希望のタブをクリックして切り替えることもできますし、[NEW].\\ をクリックすれば新しいタブを作ることもできます。

タブを閉じるには、通常の端末を閉じるのと同じように exit を入力するだけです。

Openbox の設定

~/.config/openbox/rc.xml<applications> セクションに以下の行を追加:

<application name="urxvtq">
   <decor>no</decor>
   <position force="yes">
     <x>center</x>
     <y>0</y>
   </position>
   <desktop>all</desktop>
   <layer>above</layer>
   <skip_pager>yes</skip_pager>
   <skip_taskbar>yes</skip_taskbar>
   <maximized>Horizontal</maximized>
</application>

そして、次の行を <keyboard> セクションに追加します。

<keybind key="W-t">
  <action name="Execute">
    <command>/path/to/urxvtc</command>
  </action>
</keybind>
<keybind key="W-grave">
  <action name="Execute">
    <execute>/path/to/urxvtq</execute>
  </action>
</keybind>

ここでも、/path/to/* の行を、上記で保存したスクリプトを指すように変更する必要があります。ファイルを保存して、Openbox を再設定します。これで、通常の urxvt インスタンスを Super+T で起動し、kuake 風コンソールを Super+` で切り替えられるようになったはずです。(grave key、backtick とも呼ばれる)

他の設定

この設定が urxvt kuake Perl スクリプトより優れている点は、Openbox が修飾キーなど、より多くのキーバインドオプションを提供していることです。kuake スクリプトは、修飾キーの組み合わせに関係なく、物理キー全体をハイジャックします。すべての可能性については、Openbox bindings documentation を参照してください。

Openbox per-app settings を使って、kuake-like console の動作(画面位置やレイヤーなど)をさらに設定することができます。コンソールの高さを調整するために urxvtq スクリプトレットで geometry パラメータを変更する必要があるかもしれません。

関連スクリプト

パフォーマンスの改善

  • Xft フォントは使わないでください。どうしても Xft フォントを使う必要がある場合、設定値に :antialias=false を追加してください [2]
  • 特に --disable-xft--disable-unicode3 は、不要な機能のサポートを無効にして rxvt-unicode を構築します。[3]
  • メモリ使用量を減らすために、スクロールバックバッファ内の saveLines (オプション -sl) の数を制限します。[4]
    • スクロールバックバッファーは tmux を使用し、saveLines を 0 に設定します。
  • Perlの無効化
  • urxvtdurxvtc クライアントからの接続を受け入れるデーモンとして実行することを検討してください。

デーモンクライアント

警告: サーバーがクラッシュすると、クライアントで動作している全てのプロセスが終了します。例えば xkill でサーバーをリセット・再起動すると開いているウィンドウを含む urxvtd インスタンスが終了されます。詳しくは urxvtd(1) を参照。

Xinitrc

urxvtd(1)Examples セクションを見てください。

systemd

ノート: systemd で起動した urxvt クライアント/デーモンにログインしているとき、通常ユーザーは systemctl の電源コマンド (reboot, poweroff など) を実行することはできません。クライアントがセッションに含まれなくなるからです。そのため systemd で urxvt を起動するのは推奨されません。

システムサービス:

/etc/systemd/system/urxvtd@.service
[Unit]
Description=RXVT-Unicode Daemon

[Service]
User=%i
ExecStart=/usr/bin/urxvtd -q -o

[Install]
WantedBy=multi-user.target

サービスを起動するときにユーザー名を指定します:

urxvtd@username.service

systemd/ユーザーサービスの場合、以下のユニットファイルを ~/.config/systemd/user に配置してください:

urxvtd.service
[Unit]
Description=Urxvt Terminal Daemon
Requires=urxvtd.socket

[Service]
ExecStart=/usr/bin/urxvtd -o -q
Environment=RXVT_SOCKET=%t/urxvtd-%H

[Install]
WantedBy=MyTarget.target
urxvtd.socket
[Unit]
Description=urxvt daemon (socket activation)
Documentation=man:urxvtd(1) man:urxvt(1)

[Socket]
ListenStream=%t/urxvtd-%H

[Install]
WantedBy=sockets.target

高度なタブの管理

AUR から urxvt-tabbedexAUR パッケージをインストールして、~/.XresourcesURxvt.perl-ext-common X リソースに tabbedex を追加してください:

URxvt.perl-ext-common: ...,tabbedex,...
ノート: 以前にtabbed を使用したことがある場合 Perl 拡張機能で tabbed の値を URxvt.perl-ext-common に定義している場合。X リソースとの衝突を避けるために、まず tabbedex の値を削除してください。

"[NEW]" ボタン (めったに使用されず、マウスでのみ使用可能) は、tabbedex のデフォルトでは無効になっています。この機能を再び有効にするには、new-button を true に設定します。

URxvt.tabbed.new-button: true

タブの名前は Shift+ ↑ (Enter で確定、Escape で取り消し) で付けることができます。

タブが1つしかないときにタブバーを自動的に隠すには、次のリソースを有効にします。

URxvt.tabbed.autohide: true

最後のタブで Urxvt を閉じないようにするには、以下のリソースを有効にします。

URxvt.tabbed.reopen-on-close: yes

新しいタブを開始したり、タブを循環させるには、次のユーザーコマンドを使用します。tabbedex:(new|next|prev)_tab を使用します。マッピングの例

URxvt.keysym.Control-t: perl:tabbedex:new_tab
URxvt.keysym.Control-Tab: perl:tabbedex:next_tab
URxvt.keysym.Control-Shift-Tab: perl:tabbedex:prev_tab

タブの名前を変更したり、タブを右や左に移動したりするキーバインドを独自に定義するには、以下のコマンドを使用します。tabbedex:move_tab_(left|right)tabbedex:rename_tab を使ってください。マッピングの例

URxvt.keysym.Control-Shift-Left: perl:tabbedex:move_tab_left
URxvt.keysym.Control-Shift-Right: perl:tabbedex:move_tab_right
URxvt.keysym.Control-Shift-R: perl:tabbedex:rename_tab
ノート: ユーザーコマンドに使われるキーを再定義してもデフォルトのマッピングは無効にならないので、そのためには X リソース no-tabbedex-keys を設定しなければなりません。しかし、現在このリソースは urxvt-tabbedexAUR パッケージに含まれていません。代わりに urxvt-tabbedex-gitAUR パッケージを使うことを検討してください。
URxvt.tabbed.no-tabbedex-keys: true

透過

完全透過

完全透過を使用するには、コンポジタによるコンポジットをサポートしているウィンドウマネージャを使っている必要があります。

コマンドラインから:

$ urxvt -depth 32 -bg rgba:3f00/3f00/3f00/dddd

設定ファイルを使用:

~/.Xresources
URxvt.depth: 32
URxvt.background: rgba:1111/1111/1111/dddd

または:

~/.Xresources
URxvt.depth: 32
URxvt.background: [95]#000000

'95' は透過レベル (パーセンテージ)、'#000000' は背景色に置き換えて下さい。

302351 という色を rgba:rrr/gggg/bbb/aa 構文で使う場合は、rgba:3000/2300/5100/ee00 となります。ee00"(アルファ値)を指定すると、きれいに透明になります。

ノート: これらの設定を URxvt のすべての形式に対して普遍化するために、ワイルドカードを追加することができます。例えば、 URxvt.depthURxvt*depth になります。

疑似透過

完全透過の必要がない場合、もしくはコンポジットによるシステムリソースの消費が多すぎるという場合、以下のようにして透過を使うことができます:

~/.Xresources
! Xresources file

URxvt*inheritPixmap: true
URxvt*.transparent: true
! URxvt*.shading: 0 to 99 darkens, 101 to 200 lightens
URxvt*.shading: 110

上記の URxvt*.shading の代わりに URxvt*background を使うこともできます。

ノート: URxvt.tintColor が設定されている場合は、シェーディングの使用は避けてください。代わりに別の tintColor を使用してください。

アイコンの設定

ノート: rxvt-unicode パッケージの依存関係が多すぎるというバグレポート (FS#34862) のため、icon オプションを使うには AUR パッケージ rxvt-unicode-pixbufAUR をインストールする必要があります。

デフォルトでは URxvt にはタスクバーアイコンがありません。~/.Xresources に以下の行を追加してアイコンを指定することで簡単に変更することができます:

URxvt.iconFile:    /usr/share/icons/Clarity/scalable/apps/terminal.svg

urxvt をアプリケーションランチャーとして使う

urxvt は gmrun などのアプリケーションの代わりとして使うことができます。以下の設定で urxvt を実行するとアプリケーションランチャーのように使用できます。もしくはコマンドをカスタムエイリアスに割り当ててください:

$ urxvt -geometry 80x3 -name 'bashrun' -e sh -c "/bin/bash -i -t"

Xterm のエスケープシーケンス

rxvt-unicode で Xterm のエスケープシーケンスを使うことができます。xterm の中で cat -v を実行してキーの組み合わせを確認したらキーシムを使って urxvt の設定を行います。

単語移動のバインドは以下のようになります:

~/.Xresources
!Xterm escapes, word by word movement
URxvt.keysym.Control-Left:    \033[1;5D
URxvt.keysym.Control-Right:    \033[1;5C

詳しくは ascii(7) や urxvt(1) の man ページのキーシムセクションを見てください。

双方向言語のサポート

bidi extension を使用して、ヘブライ語やアラビア語などの双方向言語のサポートを追加することができます。

ノート: 使用するフォントはその言語をサポートするものでなければなりません。例えば、ヘブライ語を表示するには、terminus のようなフォントを使用する必要があります。

ベルコマンド

ターミナルでベルが鳴ったときにシェルコマンドを実行することができます。最初に ~/.Xresources ファイルで bell-command 拡張を有効にしてください:

URxvt.perl-ext-common: ...,bell-command,...

以下の例は ALSAaplay コマンドを使って .wav ファイルを再生します:

URxvt.bell-command: aplay /path/to/a/file.wav

次の例では、libcanberracanberra-gtk-play コマンドを使って、現在のサウンドテーマのベル音を再生しています。

URxvt.bell-command: canberra-gtk-play -i bell

そして次の設定により、視覚的な通知がポップアップします。

URxvt.bell-command: notify-send "rxvt-unicode: bell!"
ノート: bell-command オプションだけ設定してもコンピュータのブザー音は無効になりません。PC スピーカーの記事を見てください。