Conky

提供: ArchWiki
2024年4月19日 (金) 01:24時点におけるKgx (トーク | 投稿記録)による版 (最新の英語版から転載)
ナビゲーションに移動 検索に移動

関連記事

Conky is a system monitor software for the X Window System (Wayland support is a work in progress). It is available for GNU/Linux and FreeBSD. It is free software released under the terms of the GPL license. Conky is able to monitor many system variables including CPU, memory, swap, disk space, temperature, top, upload, download, system messages, and much more. It is extremely configurable, however, the configuration can be a little hard to understand. Conky is a fork of torsmo.

Installation

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

Some built in variables in conky require additional packages to be installed in order to be utilized, for example mpd for music. As for hard drive temperature, Since kernel 5.6 the drivetemp module will report SATA/SAS temperature through hwmon. See the Lm_sensors#S.M.A.R.T. drive temperature discussion. From conky point of view, drivetemp can be used as a replacement for the hddtemp package and variable by using its hwmon variable.

Additional utility:

  • Conky Manager — Theme manager for Conky widgets. It provides options to start/stop, browse and edit Conky themes installed on the system.
https://teejeetech.com/conky-manager/ || conky-manager

Configuration

The configuration file can be located in one of the following paths (the first one found will be used):

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

If none of these files exist, conky will use the default built-in configuration, which you can print out with:

$ conky --print-config

Furthermore, you can create a default configuration file with the following command:

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

If you prefer to have a configuration dotfile in home, you can create a file elsewhere and tell conky to use it using arguments.

For example to tell conky to use a dotfile located in the user's home directory:

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

Additional example configuration files are available in the upstream wiki article.

When editing your configuration file while conky is running, conky will update with the new changes every time you write to the file.

See the SourceForge page for a complete reference for all Conky objects/variables; these are also listed in conky(1).

Dual screen

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,

Configuration file syntax

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.

Fonts

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

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

Autostart

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.

Troubleshooting

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

Conky starts and does not display anything on the screen

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.

Transparency

この記事あるいはセクションは Conky/Tips and tricks と合併することが議論されています。
ノート: This is not a troubleshooting section, it belongs in the Tips and tricks section. (議論: トーク:Conky#)

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

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 &

Enable real transparency

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

Semi-transparency

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.

Do not minimize on Show Desktop

Using Compiz: If the 'Show Desktop' button or key-binding minimizes Conky along with all other windows, start the Compiz configuration settings manager, go to "General Options" and uncheck the "Hide Skip Taskbar Windows" option.

Using XFCE: If clicking the desktop hides Conky, add own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', inside conky.conf.

For the other Desktop environments/WM: Try editing conky.conf and adding/changing the following line:

own_window_type = 'override',

or

own_window_type = 'desktop',

Refer to conky(1) man page for the exact differences. But the latter option enables you to snap windows to conkys border using resize key-binds in e.g. Openbox, which the first one does not.

Integrate with GNOME Shell

Some have experienced problems with conky showing up under GNOME.

Add these lines to conky.conf:

own_window = true,
own_window_type = 'desktop',

Prevent flickering

この記事またはセクションは加筆を必要としています。
理由: Explain the steps to follow if there is no dbe module, probably in xorg rather than here with a link (議論: トーク:Conky#)

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

参照