Conky

提供: ArchWiki
2024年4月19日 (金) 12:37時点におけるKgx (トーク | 投稿記録)による版 (→‎自動起動: 翻訳)
ナビゲーションに移動 検索に移動

関連記事

Conky は、X Window System 用のシステムモニターソフトウェアです (Wayland のサポートは 進行中です) GNU/Linux および FreeBSD で利用できます。これは、GPL ライセンスの条件に基づいてリリースされたフリーソフトウェアです。Conky は、CPU、メモリ、スワップ、ディスク容量、温度、トップ、アップロード、ダウンロード、システム メッセージなどを含む多くのシステム変数を監視できます。柔軟に設定可能ですが、設定を理解するのが少し難しい場合があります。Conky は torsmo のフォークです。

インストール

conky パッケージを インストール します。追加のコンパイルオプションを有効にしてインストールできる代替パッケージもあります。

conky の一部の組み込み変数 (音楽の mpd など) を利用するには、追加のパッケージをインストールする必要があります。ハードドライブの温度については、カーネル 5.6 以降 drivetemp モジュールは hwmon を通じて SATA/SAS 温度を報告します。lm_sensors#S.M.A.R.T. ドライブの温度 の議論を参照してください。conky の観点からは、drivetemp は、その hwmon 変数を使用することで、hddtemp パッケージと変数の代わりとして使用できます。

追加のユーティリティ:

  • Conky Manager — Conky ウィジェットのテーママネージャー。システムにインストールされている Conky テーマを開始/停止、参照、編集するためのオプションが提供されます。
https://teejeetech.com/conky-manager/ || conky-manager

設定

設定ファイルは、次のパスのいずれかにあります (最初に見つかったパスが使用されます):

  • ~/.config/conky/conky.conf
  • ~/.conkyrc
  • /etc/conky/conky.conf

これらのファイルが存在しない場合、conky はデフォルトの組み込み設定を使用します。これは次のように出力できます:

$ conky --print-config

さらに、次のコマンドを使用してデフォルトの設定ファイルを作成できます:

$ mkdir -p ~/.config/conky && conky --print-config > ~/.config/conky/conky.conf

ドットファイル をホームディレクトリに置きたい場合は、別の場所にファイルを作成し、引数を使用してそれを使用するように conky に指示できます。

たとえば、ユーザーのホームディレクトリにあるドットファイルを使用するように conky に指示するには:

$ conky --config=~/.conky.conf

追加の設定ファイルの例は、の上流の wiki 記事 で入手できます。

conky の実行中に設定ファイルを編集すると、ファイルに書き込むたびに conky が新しい変更内容を更新します。

すべての Conky オブジェクト/変数の完全なリファレンスについては、SourceForge ページ を参照してください。これらは conky(1) にもリストされています。

デュアルスクリーン

デュアルスクリーン設定を使用する場合、conky ウィンドウをデスクトップ上の希望の場所に配置するには、いくつかのオプションを調整する必要があります。

1680x1050 ピクセルの解像度を実行していて、ウィンドウを左モニターの中央上部に配置したい場合。gap_x を調整して次のように使用します:

alignment = 'top_left',
gap_x = 840,

alignment オプションは一目瞭然で、gap_X は画面の左端からの距離 (ピクセル単位) です。

xinerama_head は代替の便利なオプションです。次のようにすると、conkyウィンドウが 2 番目の画面の右上に配置されます。

alignment = 'top_right',
xinerama_head = 2,

設定ファイルのシンタックス

Conky 1.10 (2015Q2 頃) 以降、設定ファイルは次のような Lua シンタックスで記述されます。

 conky.config = {
   -- Comments start with a double dash
   bool_value = true,
   string_value = 'foo',
   int_value = 42,
 }
 conky.text = [[
 $variable
 ${evaluated variable}
 ]]

1.10 より前では、次のような古いシンタックスが使用されます。

 bool_value yes
 string_value 'foo'
 int_value 42

古いシンタックスから新しい Lua シンタックスに変換する Lua スクリプトが利用可能です の GitHub リポジトリ スクリプトは /usr/share/doc/conky-1.15.0_pre/convert.lua にもあります。

フォント

conky で Unicode の画像と絵文字を表示するには、これをサポートする フォント が必要で、表示したい Unicode のフォントを使用するように conky を設定します。例えば:

 ${font Symbola:size=48}☺${font}

記号フォント

シンボリックフォントは、より装飾された conky 設定でもよく使用されます。最も人気のあるものには次のようなものがあります:

自動起動

自動起動 で説明されているように、Conky を自動的に起動するにはいくつかの方法があります。

Conky には、バックグラウンドにフォークするように指示する構成設定があります。これは、一部の自動起動セットアップでは望ましい場合があります。

In conky.conf:

conky.config = {
    background = true,
}

グラフィカルデスクトップ環境を使用していて、自動起動に conky.desktop ファイルを使用したい場合は、次を使用します:

~/.config/autostart/conky.desktop
[Desktop Entry]
Type=Application
Name=conky
Exec=conky --daemonize --pause=5
StartupNotify=false
Terminal=false

pause=5 パラメータは、起動時に conky の描画を 5 秒間遅らせ、デスクトップがロードされて起動する時間が確保されるようにします。

トラブルシューティング

These are known issues people have with conky and their solutions.

Conky が起動しても画面に何も表示されない

First check for syntax errors in your configuration file's text variable. Then double check that your user has permission to run every command inside your configuration file and that all needed packages are installed.

透明

Conky supports two different types of transparency. Pseudo-transparency and real transparency that requires a composite manager to be installed and running. If you enable real transparency and do not have a composite manager running your conky will not be alpha transparent with transparency enabled for fonts and images as well as the background.

擬似透明

Pseudo-transparency is enabled by default in conky. Pseudo-transparency works by copying the background image from the root window and using the relevant section as the background for conky. Some window managers set the background wallpaper to a level above the root window which can cause conky to have a grey background. To fix this issue you need to set it manually. An example with feh is:

In ~/.xinitrc:

sleep 1 && feh --bg-center ~/background.png &

本当の透明性を有効にする

To enable real transparency, you must have a composite manager running and the following lines added to .conkyrc inside the conky.config array:

 conky.config = {
    own_window = true,
    own_window_transparent = true,
    own_window_argb_visual = true,
    own_window_type = 'desktop',
 }

If window type "desktop" does not work try changing it to normal. If that does not work try the other options: dock, panel, or override instead.

ノート: Xfce requires enabled compositing, see [1].

半透明

To achieve semi-transparency in real transparency mode, the following setup must be used in the conky configuration file:

 conky.config = {
    own_window = true,
    own_window_transparent = false,
    own_window_argb_visual = true,
    own_window_argb_value = 90,
    own_window_type = 'desktop',
 }

To reduce the transparency of the conky window, one can increase the value of own_window_argb_value towards 255.

Show Desktop で最小化しないようにする

Compiz を使用: 'Show Desktop' ボタンまたはキーバインディングによって Conky が他のすべてのウィンドウとともに最小化される場合は、Compiz 構成設定マネージャーを起動し、"General Options" に移動し、"Hide Skip Taskbar Windows" のチェックを外します。

XFCE を使用: デスクトップをクリックすると Conky が非表示になる場合は conky.conf 内に own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', を追加します。

その他の デスクトップ環境/ウィンドウマネージャ: の場合: conky.conf を編集し、次の行を追加/変更してみてください:

own_window_type = 'override',

もしくは

own_window_type = 'desktop',

正確な違いについては、conky(1) man ページ を参照してください。ただし、後者のオプションを使用すると、Openbox などでサイズ変更キーバインドを使用してウィンドウを conky の境界線にスナップできますが、最初のオプションではできません。

GNOME シェルとの統合

Some have experienced problems with conky showing up under GNOME.

Add these lines to conky.conf:

own_window = true,
own_window_type = 'desktop',

ちらつきを防ぐ

Conky needs Double Buffer Extension (DBE) support from the X server to prevent flickering because it cannot update the window fast enough without it. It can be enabled with Xorg in /etc/X11/xorg.conf with Load "dbe" line in "Module" section. The xorg.conf file has been replaced (1.8.x patch upwards) by /etc/X11/xorg.conf.d which contains the particular configuration files. DBE is loaded automatically as long as it is present within /usr/lib/xorg/modules. The list of loaded modules can be checked with grep LoadModule /var/log/Xorg.0.log.

To enable double buffering, add the double_buffer option to conky.conf:

 conky.config = {
     double_buffer = true,
 }

参照