Conky

提供: ArchWiki
2024年4月19日 (金) 01:45時点における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) にもリストされています。

デュアルスクリーン

When using a dual screen configuration, you will need to play with a few options to place your conky window where you want it on the desktop.

By adjusting gap_x, let us say you are running a 1680x1050 pixels resolution and you want the window on middle top of your left monitor, you will use:

alignment = 'top_left',
gap_x = 840,

The alignment option is self-explanatory, the gap_X is the distance, in pixels, from the left border of your screen.

xinerama_head is an alternative useful option, the following will place the conky window at the top right of the second screen:

alignment = 'top_right',
xinerama_head = 2,

設定ファイルの構文

Since Conky 1.10 (Circa 2015Q2), configuration files are written with a Lua syntax, like so:

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

Pre 1.10 use the old syntax, which looks like this:

 bool_value yes
 string_value 'foo'
 int_value 42

A Lua script is available to convert from the old syntax to the new Lua syntax at the GitHub repository. The script is also at /usr/share/doc/conky-1.15.0_pre/convert.lua.

フォント

For displaying Unicode pictures and emoji with conky you will need a font that supports this and then configure conky to use the font with the Unicode you want to display. For example:

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

記号フォント

Symbolic fonts are also very commonly used in more decorated conky configurations, some of the more popular ones include;

自動起動

There are several different ways to start Conky automatically, as outlined in Autostarting.

Conky has a configuration setting which will tell it to fork to the background. This may be desirable for some autostarting setups.

In conky.conf:

conky.config = {
    background = true,
}

If you use a graphical desktop environment and wish to use a conky.desktop file for autostarting, use the following:

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

The pause=5 parameter delays conky's drawing for 5 seconds at startup to make sure that the desktop had time to load and is up.

トラブルシューティング

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,
 }

参照