「Conky」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(他言語へのリンクを修正)
(一部翻訳)
(同じ利用者による、間の1版が非表示)
4行目: 4行目:
 
[[fr:Conky]]
 
[[fr:Conky]]
 
[[zh-hans:Conky]]
 
[[zh-hans:Conky]]
  +
{{Related articles start}}
Conky は X Windows System 向けのシステム監視ソフトウェアです。GNU/Linux と FreeBSD で利用することができます。GPL ライセンスでリリースされているフリーソフトウェアになります。CPU, メモリー, スワップ, ディスク容量, 温度, top, アップロード, ダウンロード, システムメッセージなど、様々なシステムの情報を Conky はモニターすることが可能です。色々と設定することができますが、設定は少々わかりにくいかもしれません。Conky は torsmo のフォークです。
 
  +
{{Related|Conky/ヒントとテクニック}}
  +
{{Related|Lm_sensors}}
  +
{{Related|Hddtemp}}
  +
{{Related articles end}}
   
  +
[[Wikipedia:Conky (software)|Conky]] は、X Window System 用のシステムモニターソフトウェアです (Wayland のサポートは [https://github.com/brndnmtthws/conky/issues/56 進行中です]) GNU/Linux および FreeBSD で利用できます。これは、GPL ライセンスの条件に基づいてリリースされたフリーソフトウェアです。Conky は、CPU、メモリ、スワップ、ディスク容量、温度、トップ、アップロード、ダウンロード、システム メッセージなどを含む多くのシステム変数を監視できます。柔軟に設定可能ですが、設定を理解するのが少し難しい場合があります。''Conky'' は torsmo のフォークです。
== インストールと設定 ==
 
   
  +
== インストール ==
{{Pkg|conky}} パッケージを[[インストール]]してください。機能が追加された他のパッケージについては [[#AUR パッケージ]]を見てください。
 
   
  +
{{Pkg|conky}} パッケージを [[インストール]] します。追加のコンパイルオプションを有効にしてインストールできる代替パッケージもあります。
ローカルの設定ファイルを作成してください:
 
$ mkdir -p ~/.config/conky
 
$ conky -C > ~/.config/conky/conky.conf
 
   
  +
* {{AUR|conky-cli}} - X11 依存関係のない conky
{{ic|~/.config/conky/conky.conf}} を編集することで好きに conky をカスタマイズできます。[https://github.com/brndnmtthws/conky/wiki/User-Configs こちらのページ] には設定ファイルのサンプルが載っています。
 
  +
* {{AUR|conky-lua-nv}} - Lua と Nvidia の両方をサポート
   
  +
conky の一部の組み込み変数 (音楽の [[mpd]] など) を利用するには、追加のパッケージをインストールする必要があります。ハードドライブの温度については、[https://hwmon.wiki.kernel.org/device_support_status カーネル 5.6 以降] {{ic|drivetemp}} モジュールは hwmon を通じて SATA/SAS 温度を報告します。[[lm_sensors#S.M.A.R.T. ドライブの温度]] の議論を参照してください。conky の観点からは、{{ic|drivetemp}} は、その {{ic|hwmon}} 変数を使用することで、[[hddtemp]] パッケージと変数の代わりとして使用できます。
設定ファイルを編集すると、保存した瞬間に変更が適用されます。X セッションをログアウト・ログインする必要はありません。設定を何かテストしたいときは、設定ファイルを保存してみて ''conky'' のウィンドウがどうなったか確認するのが良いでしょう。
 
   
  +
追加のユーティリティ:
''conky'' の素晴らしい機能として {{ic|/var/log/}} ファイルからログメッセージを読み込んでデスクトップに表示させることができます。ほとんどのログファイルは {{ic|root}} しか読めないようになっていますが、''conky'' を {{ic|root}} で動作させることは推奨されません。代わりに使用しているユーザーを {{ic|log}} グループに追加してください:
 
  +
* {{App|Conky Manager|Conky ウィジェットのテーママネージャー。システムにインストールされている Conky テーマを開始/停止、参照、編集するためのオプションが提供されます。|https://teejeetech.com/conky-manager/|{{Pkg|conky-manager}}}}
# usermod -aG log ''username''
 
   
  +
== 設定 ==
=== AUR パッケージ ===
 
   
  +
設定ファイルは、次のパスのいずれかにあります (最初に見つかったパスが使用されます):
基本の '''conky''' パッケージに加えて、追加のコンパイルオプションを有効にした [[AUR]] のパッケージがいくつか存在します:
 
   
* {{App|conky-cli|X11 依存を取り除いた Conky||{{AUR|conky-cli}}}}
+
* {{ic|~/.config/conky/conky.conf}}
  +
* {{ic|~/.conkyrc}}
* {{App|conky-lua|Lua サポートが付いた Conky||{{AUR|conky-lua}}}}
 
  +
* {{ic|/etc/conky/conky.conf}}
* {{App|conky-lua-nv|Lua と Nvidia サポートが付いた Conky||{{AUR|conky-lua-nv}}}}
 
* {{App|conky-nvidia|Nvidia サポートが付いた Conky||{{AUR|conky-nvidia}}{{Broken package link|パッケージが存在しません}}}}
 
   
  +
これらのファイルが存在しない場合、conky はデフォルトの組み込み設定を使用します。これは次のように出力できます:
== ヒントとテクニック ==
 
   
  +
$ conky --print-config
=== 設定ファイルの構文の変更 ===
 
   
Conky 1.10 から、設定ファイルは以下のように Lua の構文直されした:
+
次のコマンドを使用してデフォルトの設定ファイルを作成できま:
   
  +
$ mkdir -p ~/.config/conky && conky --print-config > ~/.config/conky/conky.conf
conky.config = {
 
-- Comments start with a double dash
 
bool_value = true,
 
string_value = 'foo',
 
int_value = 42,
 
}
 
conky.text = [[
 
$variable
 
${evaluated variable}
 
]]
 
   
  +
[[ドットファイル]] をホームディレクトリに置きたい場合は、別の場所にファイルを作成し、引数を使用してそれを使用するように conky に指示できます。
下で紹介しているサンプルは以下のような古い構文を使用している場合があります:
 
   
  +
たとえば、ユーザーのホームディレクトリにあるドットファイルを使用するように conky に指示するには:
bool_value yes
 
string_value 'foo'
 
int_value 42
 
   
  +
$ conky --config=~/.conky.conf
古い構文を新しい Lua 構文に変換する Lua スクリプトが [https://github.com/brndnmtthws/conky/blob/master/extras/convert.lua こちら] にあります。
 
   
  +
追加の設定ファイルの例は、[https://github.com/brndnmtthws/conky/wiki/Configs の上流の wiki 記事] で入手できます。
何かがおかしかったり、スクリプトを信用できない場合、デフォルトの設定ファイルから設定をやり直してください:
 
   
  +
conky の実行中に設定ファイルを編集すると、ファイルに書き込むたびに conky が新しい変更内容を更新します。
$ conky -C > conky.conf.default
 
   
  +
すべての Conky オブジェクト/変数の完全なリファレンスについては、[https://conky.sourceforge.net/variables.html SourceForge ページ] を参照してください。これらは {{man|1|conky}} にもリストされています。
=== KDE4 や Xfce4 で完全透過を有効にする ===
 
   
  +
=== デュアルスクリーン ===
バージョン 1.8.0 から、Conky は完全透過をサポートしています。有効にするには以下の行を {{ic|conky.conf}} に追加して下さい:
 
own_window_transparent = true,
 
   
  +
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.
上のオプションは {{ic|OWN_WINDOW_ARGB_VISUAL yes}} オプションと一緒に使うのは望ましくありません。下で説明している {{Pkg|feh}} の方法を置き換えます。
 
 
{{Note|1=[[Xfce]] はコンポジットの有効化を必要とします。[https://forum.xfce.org/viewtopic.php?pid=25939] を見て下さい。}}
 
 
=== Xfce4 で自動起動 ===
 
 
{{ic|conky.conf}} ファイルに以下を追加:
 
background = true,
 
 
この変数は Conky をバックグラウンドにフォークします。ウィンドウをデスクトップ上に常に表示させ、全てのワークスペースに張り付かせてタスクバーには表示したくない場合、以下の引数を追加してください:
 
own_window = true,
 
own_window_type = 'override',
 
override オプションは ''conky'' のウィンドウがウィンドウマネージャの制御下から外れるようにします。
 
 
{{ic|~/.config/autostart/conky.desktop}} を追加:
 
[Desktop Entry]
 
Encoding=UTF-8
 
Version=0.9.4
 
Type=Application
 
Name=conky
 
Comment=
 
Exec=conky -d
 
StartupNotify=false
 
Terminal=false
 
Hidden=false
 
 
=== ちらつきを防止する ===
 
 
Conky はちらつきを防止するために X サーバーの Double Buffer Extension (DBE) サポートを必要とします。これがないとウィンドウを高速に更新することができません。{{ic|/etc/X11/xorg.conf}} で {{ic|"Module"}} セクションに {{ic|Load "dbe"}} 行を追加することで有効にできます。(1.8.x パッチ以上では) {{ic|xorg.conf}} ファイルは個別の設定ファイルが入っている {{ic|/etc/X11/xorg.conf.d}} で置き換えられています。''DBE'' は自動でロードされます。
 
 
ダブルバッファリングを有効にするには {{ic|conky.conf}} に以下を追加してください:
 
double_buffer = true,
 
 
=== カスタムカラー ===
 
 
クラシックなプリセットカラーの他に (white, black, yellow...)、カラーネームコードを使ってカスタムカラーを設定することができます。色のコードを確認するには、色選択アプリを使って下さい。[[公式リポジトリ]]に入っている {{Pkg|gcolor2}} パッケージが色の名前を教えてくれます。カラーコードは6桁の16進数からなります (0-9, A-F)。カスタムカラーを使うには設定ファイルに以下の行を追加してください:
 
color0 = 'white', --convention for standard named colors
 
color1 = '00CC00', --convention for hex colors: no pound sign
 
そして、{{ic|TEXT}} セクションを編集するときに、事前に定義したカスタムカラー番号を使って下さい。
 
 
=== デュアルスクリーン ===
 
   
  +
By adjusting {{ic|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:
デュアルスクリーン設定を使う場合は、conky のウィンドウを配置するための2つのオプションをいじる必要があります。例えば 1680X1050 ピクセルの解像度を使っていて、左モニターの中央上にウィンドウを置きたい場合、以下を使います:
 
 
alignment = 'top_left',
 
alignment = 'top_left',
gap_X = 840,
+
gap_x = 840,
  +
The {{ic|alignment}} option is self-explanatory, the {{ic|gap_X}} is the distance, in pixels, from the left border of your screen.
{{ic|alignment}} オプションはそのままの意味で、{{ic|gap_X}} オプションは画面の左端からの距離をピクセルで表します。
 
   
  +
{{ic|xinerama_head}} is an alternative useful option, the following will place the ''conky'' window at the top right of the second screen:
{{ic|xinerama_head}} オプションも設定する必要があるかもしれません。
 
  +
alignment = 'top_right',
  +
xinerama_head = 2,
   
  +
=== 設定ファイルの構文 ===
=== デスクトップの表示で最小化させない ===
 
   
  +
Since Conky 1.10 (Circa 2015Q2), configuration files are written with a [[Lua]] syntax, like so:
Compiz を使っている場合: 'デスクトップを表示' ボタンやキーバインドで、他のウィンドウと一緒に Conky も最小化されてしまう場合、Compiz の設定マネージャを起動して、"General Options" を開いて "Hide Skip Taskbar Windows" オプションのチェックを外して下さい。
 
   
  +
conky.config = {
Compiz を使っていない場合は、{{ic|conky.conf}} を編集して以下の行を追加または修正してください:
 
  +
-- 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:
own_window_type = 'override',
 
   
  +
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 [https://github.com/brndnmtthws/conky/blob/master/extras/convert.lua at the GitHub repository]. The script is also at {{ic|/usr/share/doc/conky-1.15.0_pre/convert.lua}}.
own_window_type = 'desktop',
 
   
  +
== フォント ==
詳しい違いについては conky の man ページを参照。ただし後者のオプションでは [[Openbox]] などでリサイズのキーバインドを使ってウィンドウを conky の縁に調整することができます。前者は出来ません。
 
   
  +
For displaying Unicode pictures and emoji with conky you will need a [[Fonts#Emoji and symbols|font]] that supports this and then configure conky to use the font with the Unicode you want to display. For example:
=== GNOME との統合 ===
 
   
  +
${font Symbola:size=48}☺${font}
GNOME で Conky を表示したときに問題が生じる場合、以下の行を {{ic|conky.conf}} に追加:
 
own_window yes
 
own_window_type conky
 
own_window_transparent yes
 
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
   
  +
=== 記号フォント ===
透過に問題が起こる場合、以下の行を追加してみてください:
 
own_window_argb_visual yes
 
own_window_argb_value 255
 
   
  +
Symbolic fonts are also very commonly used in more decorated conky configurations, some of the more popular ones include;
=== Razor-qt との統合 ===
 
   
  +
* {{Pkg|otf-font-awesome}}
Conky のデフォルト設定では、後ろをクリックするとデスクトップからウィンドウが消えることがあります。以下の行を追加してください:
 
  +
* {{AUR|ttf-pizzadude-bullets}} - PizzaDude Bullet's font
{{hc|conky.conf|own_window yes
 
  +
* {{AUR|ttf-weather-icons}} - Erik flowers weather icon font with 222 glyphs
own_window_class Conky
 
own_window_type normal
 
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
own_window_transparent yes
 
}}
 
   
  +
== 自動起動 ==
=== パッケージの更新情報を表示 ===
 
   
  +
There are several different ways to start Conky automatically, as outlined in [[Autostarting]].
* [[Pacman]] には {{ic|checkupdates}} という公式リポジトリのパッケージアップデートを表示する自前のスクリプトが入っています。{{ic|<nowiki>${execpi 3600 checkupdates | wc -l}</nowiki>}} でパッケージの合計が表示されます。
 
* [https://bbs.archlinux.org/viewtopic.php?id=68104 Paconky] - ユーザー定義形式でパッケージのアップデート情報を表示します。{{ic|<nowiki>${execpi}</nowiki>}} コマンドを使うことでこのプログラムの出力は conky に含めることができます。
 
* [https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - スクロールするアップデート通知を表示。Paconky と作者が同じ。
 
* [https://bbs.archlinux.org/viewtopic.php?id=57291 Perl Script] - Paconky の作者によるシンプルで簡単なスクリプト。アップデートが必要なパッケージの数だけを表示。
 
* [https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - [[Python]] で書かれたアップデート通知プログラム。
 
* [https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - ShowSize を有効にしたユーザーのための [[Bash]] スクリプト。
 
   
  +
Conky has a configuration setting which will tell it to fork to the background. This may be desirable for some autostarting setups.
=== 天気予報を表示 ===
 
   
  +
In {{ic|conky.conf}}:
[https://bbs.archlinux.org/viewtopic.php?id=37381 このスレッド] を参照。
 
  +
conky.config = {
  +
background = true,
  +
}
   
  +
If you use a graphical desktop environment and wish to use a {{ic|conky.desktop}} file for autostarting, use the following:
=== カウントダウンタイマーを表示 ===
 
[https://github.com/orschiro/scriptlets/tree/master/ConkyTimer ConkyTimer] は作業の残り時間を表示するシンプルなカウントダウンタイマーです。
 
   
  +
{{hc|~/.config/autostart/conky.desktop|2=
{{ic|conkytimer "<task description>" <min>}} でタイマーを開始できます。
 
  +
[Desktop Entry]
  +
Type=Application
  +
Name=conky
  +
Exec=conky --daemonize --pause=5
  +
StartupNotify=false
  +
Terminal=false}}
   
  +
The {{ic|1=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.
=== RSS フィードを表示 ===
 
   
  +
== トラブルシューティング ==
外部のスクリプトを実行したり Conky に出力したりすることなく、RSS フィードをネイティブに表示する機能が Conky には備わっています。例えば、Planet Arch の最新の記事のタイトル10件を表示して一分ごとにフィードを更新したい場合、以下を {{ic|conky.conf}} の {{ic|TEXT}} セクションに挿入します:
 
   
  +
These are known issues people have with conky and their solutions.
${rss https://planet.archlinux.org/rss20.xml 1 item_titles 10 }
 
Arch フォーラムの rss フィードを表示したい場合、次の行を追加します:
 
${rss https://bbs.archlinux.org/extern.php?action=feed&type=rss 1 item_titles 4}
 
1 は更新間隔で (15分がデフォルト)、4 は表示するアイテムの数です。
 
   
=== rTorrent の統計を表示 ===
+
=== 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.
[https://bbs.archlinux.org/viewtopic.php?id=67304 このスレッド]を参照。
 
   
  +
=== 透明 ===
=== WordPress ブログの統計を表示 ===
 
   
  +
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.
python で書かれた [http://evilshit.wordpress.com/2013/04/20/conkypress-a-wordpress-stats-visualization-tool-for-your-desktop/ ConkyPress] という名前の拡張を使うことで表示できます。
 
   
  +
==== 擬似透明 ====
=== 新規メールの数を表示 ===
 
   
  +
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:
==== Gmail ====
 
   
  +
In {{ic|~/.xinitrc}}:
===== 方法 1 =====
 
   
  +
sleep 1 && feh --bg-center ~/background.png &
どこかに {{ic|gmail.py}} という名前のファイルを作って (ここでは {{ic|~/.scripts/}} を使用) 以下の [[Python]] コードを入力してください:
 
   
  +
==== 本当の透明性を有効にする ====
{{hc|gmail.py|<nowiki>
 
#!/usr/bin/env python
 
   
  +
To enable real transparency, you must have a [[composite manager]] running and the following lines added to {{ic|.conkyrc}} inside the conky.config array:
from urllib.request import FancyURLopener
 
   
  +
conky.config = {
email = 'your email' # @gmail.com can be left out
 
  +
own_window = true,
password = 'your password'
 
  +
own_window_transparent = true,
  +
own_window_argb_visual = true,
  +
own_window_type = 'desktop',
  +
}
   
  +
If window type "desktop" does not work try changing it to {{ic|normal}}. If that does not work try the other options: {{ic|dock}}, {{ic|panel}}, or {{ic|override}} instead.
url = 'https://%s:%s@mail.google.com/mail/feed/atom' % (email, password)
 
   
  +
{{Note|1=[[Xfce]] requires enabled compositing, see [https://forum.xfce.org/viewtopic.php?pid=25939].}}
opener = FancyURLopener()
 
page = opener.open(url)
 
   
  +
==== 半透明 ====
contents = page.read().decode('utf-8')
 
   
  +
To achieve semi-transparency in real transparency mode, the following setup must be used in the conky configuration file:
ifrom = contents.index('<fullcount>') + 11
 
ito = contents.index('</fullcount>')
 
   
  +
conky.config = {
fullcount = contents[ifrom:ito]
 
  +
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 {{ic|own_window_argb_value}} towards 255.
print(fullcount + ' new')
 
</nowiki>}}
 
   
  +
=== Show Desktop で最小化しないようにする ===
===== 方法 2 =====
 
   
  +
'''Compiz を使用:''' 'Show Desktop' ボタンまたはキーバインディングによって Conky が他のすべてのウィンドウとともに最小化される場合は、Compiz 構成設定マネージャーを起動し、"General Options" に移動し、"Hide Skip Taskbar Windows" のチェックを外します。
以下のスクリプトは Python の機能を活用しています:
 
   
  +
'''XFCE を使用:''' デスクトップをクリックすると Conky が非表示になる場合は {{ic|conky.conf}} 内に {{ic|1=own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',}} を追加します。
{{hc|gmail.py|<nowiki>
 
#! /usr/bin/env python
 
   
  +
'''その他の [[デスクトップ環境]]/[[ウィンドウマネージャ]]:''' の場合: conky.conf を編集し、次の行を追加/変更してみてください:
import urllib.request
 
  +
own_window_type = 'override',
from xml.etree import ElementTree as etree
 
   
  +
もしくは
# Enter your username and password below within quotes below, in place of ****.
 
# Set up authentication for gmail
 
auth_handler = urllib.request.HTTPBasicAuthHandler()
 
auth_handler.add_password(realm='mail.google.com',
 
uri='https://mail.google.com/',
 
user= '****',
 
passwd= '****')
 
opener = urllib.request.build_opener(auth_handler)
 
# ...and install it globally so it can be used with urlopen.
 
urllib.request.install_opener(opener)
 
   
  +
own_window_type = 'desktop',
gmail = 'https://mail.google.com/gmail/feed/atom'
 
NS = '{http://purl.org/atom/ns#}'
 
with urllib.request.urlopen(gmail) as source:
 
tree = etree.parse(source)
 
fullcount = tree.find(NS + 'fullcount').text
 
   
  +
正確な違いについては、{{man|1|conky}} [[man ページ]] を参照してください。ただし、後者のオプションを使用すると、Openbox などでサイズ変更キーバインドを使用してウィンドウを ''conky'' の境界線にスナップできますが、最初のオプションではできません。
print(fullcount + ' new')
 
</nowiki>}}
 
   
  +
=== GNOME シェルとの統合 ===
次の行を {{ic|conky.conf}} に追加すれば、5分 (300秒) ごとに新しいメールがないか Gmail アカウントをチェックして表示するようになります:
 
${execpi 300 python ~/.scripts/gmail.py}
 
   
  +
Some have experienced problems with ''conky'' showing up under [[GNOME]].
===== 方法 3 =====
 
   
  +
Add these lines to {{ic|conky.conf}}:
同じやり方で {{ic|curl}}, {{ic|grep}}, {{ic|sed}} を使う方法:
 
  +
own_window = true,
 
  +
own_window_type = 'desktop',
<nowiki>$ curl -s -u email:password https://mail.google.com/mail/feed/atom | grep fullcount | sed 's/<[^0-9]*>//g'</nowiki>
 
   
  +
=== ちらつきを防ぐ ===
''email'' と ''password'' はあなたのデータに置き換えて下さい。
 
   
  +
''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 {{ic|/etc/X11/xorg.conf}} with {{ic|Load "dbe"}} line in {{ic|"Module"}} section. The {{ic|xorg.conf}} file has been replaced (1.8.x patch upwards) by {{ic|/etc/X11/xorg.conf.d}} which contains the particular configuration files. ''DBE'' is loaded automatically as long as it is present within {{ic|/usr/lib/xorg/modules}}. The list of loaded modules can be checked with {{ic|grep LoadModule /var/log/Xorg.0.log}}.
===== 方法 4 =====
 
   
  +
To enable double buffering, add the {{ic|double_buffer}} option to {{ic|conky.conf}}:
また、{{Pkg|stunnel}} パッケージの [http://www.stunnel.org/ stunnel] を使うこともできます。
 
   
  +
conky.config = {
以下の設定は [https://github.com/brndnmtthws/conky/wiki/FAQ Conky の FAQ] から引用しています。
 
  +
double_buffer = true,
 
  +
}
以下のように {{ic|/etc/stunnel/stunnel.conf}} を編集して、{{ic|stunnel.service}} を[[起動]]:
 
# Service-level configuration for TLS server
 
[imap]
 
client = yes
 
accept = 143
 
connect = imap.gmail.com:143
 
protocol = imap
 
sslVersion = TLSv1
 
# Service-level configuration for SSL server
 
[imaps]
 
client = yes
 
accept = 993
 
connect = imap.gmail.com:993
 
 
後は {{ic|conky.conf}} だけです:
 
imap localhost username * -i 120 -p 993
 
TEXT
 
Inbox: ${imap_unseen}/${imap_messages}
 
 
Here I used {{ic|*}} as the password for conky to ask for it at start, but you do '''not''' have to do it.
 
 
==== IMAP + SSL と Perl を使う ====
 
 
Conky には IMAP アカウントのサポートが組み込まれていますが SSL はサポートしていません。[http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html このフォーラムへの投稿] にあるスクリプトを使うことで利用することができます。{{Pkg|perl-mail-imapclient}} と {{Pkg|perl-io-socket-ssl}} パッケージの Perl/CPAN Modules Mail::IMAPClient と IO::Socket::SSL が必要です。
 
 
Conky に読み込ませる場所に {{ic|imap.pl}} という名前のファイルを作成してください。このファイルには、以下の内容を記述します (必要なところは書き換えて下さい):
 
#!/usr/bin/perl
 
 
# gimap.pl by gxmsgx
 
# description: get the count of unread messages on imap
 
 
use strict;
 
use Mail::IMAPClient;
 
use IO::Socket::SSL;
 
 
my $username = 'example.username';
 
my $password = 'password123';
 
 
my $socket = IO::Socket::SSL->new(
 
PeerAddr => 'imap.server',
 
PeerPort => 993
 
)
 
or die "socket(): $@";
 
 
my $client = Mail::IMAPClient->new(
 
Socket => $socket,
 
User => $username,
 
Password => $password,
 
)
 
or die "new(): $@";
 
 
if ($client->IsAuthenticated()) {
 
my $msgct;
 
 
$client->select("INBOX");
 
$msgct = $client->unseen_count||'0';
 
print "$msgct\n";
 
}
 
 
$client->logout();
 
 
{{ic|conky.conf}} に次を追加:
 
${execpi 300 ~/.conky/imap.pl}
 
ファイルの位置は適宜変更してください。
 
 
Gmail を使う場合、アプリパスワードを [https://www.google.com/accounts/IssuedAuthSubTokens?hide_authsub=1 生成] する必要があります。
 
 
もしくは、上に書かれているように stunnel を使うこともできます: [[#Gmail]]。
 
 
==== IMAP と PHP を使う ====
 
PHP を使う方法もあります。[[PHP]] をインストールして {{ic|/etc/php/php.ini}} の {{ic|1=extension=imap.so}} をアンコメントしてください。
 
 
それから {{ic|imap.php}} という名前のファイルを作成して実行可能属性を付与してください:
 
$ chmod +x imap.php
 
 
ファイルの中身は以下のようにします (適宜変更を加えてください):
 
 
#!/usr/bin/php
 
<?php
 
// See http://php.net/manual/function.imap-open.php for more information about
 
// the mailbox string in the first parameter of imap_open.
 
// This example is ready to use with Office 365 Exchange Mails,
 
// just replace your username (=email address) and the password.
 
$mbox = imap_open("{outlook.office365.com:993/imap/ssl/novalidate-cert}", "username", "password");
 
 
// Total number of emails
 
$nrTotal = imap_num_msg($mbox);
 
 
// Number of unseen emails. There are other ways using imap_status to count
 
// unseen messages, but they don't work with Office 365 Exchange. This one does.
 
$unseen = imap_search($mbox, 'UNSEEN');
 
$nrUnseen = $unseen ? count($unseen) : 0;
 
 
// Display the result, format as you like.
 
echo $nrUnseen.'/'.$nrTotal;
 
 
// Not needed, because the connection is closed after the script end.
 
// For the sake of clean public available scripts, we are nice to
 
// the imap server and close the connection manually.
 
imap_close($mbox);
 
 
{{ic|conky.conf}} に以下を追加:
 
 
${execpi 300 ~/.conky/imap.php}
 
 
上記のスクリプトは A/B と表示します。A は未読メールの数で B はメールボックスに存在するメールの合計数です。imap_Status などの PHP 関数を使うことで他の情報も表示できます (http://php.net/manual/function.imap-status.php)。IMAP に関する PHP ドキュメントを見てください: http://php.net/manual/ref.imap.php 。
 
 
=== 有効なネットワークインターフェイスを表示 ===
 
 
ネットワークインターフェイスが有効化どうかテストするために、conky の {{ic|if_existing}} 変数を使ってインターフェイスの {{ic|operstate}} を確認できます。以下はインターフェイスが {{ic|wlo1}} の場合の例です:
 
 
{{bc |draw_graph_borders yes
 
${if_existing /sys/class/net/wlo1/operstate up}
 
${color #0077ff}Net Down:$color ${downspeed wlo1} ${color #0077ff}Net Up:$color ${upspeed wlo1}
 
${color #0077ff}${downspeedgraph wlo1 32,155 104E8B 0077ff} $alignr${color #0077ff}${upspeedgraph wlo1 32,155 104E8B 0077ff}
 
${endif}
 
}}
 
 
次の画像のように表示されます: https://i.imgur.com/pQQbsP6.png
 
 
=== UTF-8 マルチバイト文字のスクロールの修正 ===
 
 
現在のバージョンの conky (1.9.0) には文字列ではなくバイト数によってスクロールするテキストが増えるというバグが存在し [https://github.com/brndnmtthws/conky/issues/129]、結果としてマルチバイト文字を含むテキストでスクロールが消えたり現れたりするということが起こります。このバグを修正するパッチをあてたパッケージが AUR に存在します: {{AUR|conky-utfscroll}}{{Broken package link|パッケージが存在しません}}。
 
 
=== nvidia サポートのサンプルリングスクリプト ===
 
 
[https://gist.github.com/anonymous/85d052c0c23e58bc3666] を参照。
 
 
=== 記号フォントに関する注意 ===
 
 
装飾がある {{ic|conky.conf}} では大抵 PizzaDude Bullets と Pie Charts for Maps フォントを使っています。これらのフォントはそれぞれ {{AUR|ttf-pizzadude-bullets}} と {{AUR|ttf-piechartsformaps}}{{Broken package link|{{aur-mirror|ttf-piechartsformaps}}}} として AUR からインストールすることができ、もしくは[[フォント]]の記事に書かれている方法を使って手動でインストールすることもできます。
 
 
=== 本来よりフォントが小さく表示される ===
 
 
conky のフォントがやけに小さく表示されたり、ちゃんと並ばない場合、[[infinality]] の freetype2 パッチのデフォルト設定が原因かもしれません。この設定は 96 DPI ではなく 72 DPI でフォントを表示するプログラムに問題を生じさせます。たとえシステムを 96 DPI に設定していても関係ありません。この問題を修正するには {{ic|/etc/fonts/infinality/infinality.conf}} を開いて DPI のセクションを探して 72 から 96 に変更してください。
 
 
=== 完全透過を有効にする万能の方法 ===
 
 
透過は conky における KAIJU ですが、''xcompmgr'' と ''transset-df'' を使ってどんな環境やウィンドウマネージャでも完全透過を適用する方法が存在します。{{Pkg|xcompmgr}} と {{AUR|transset-df}} を[[インストール]]してください。
 
 
{{Note|他のコンポジットマネージャを使っている場合、この方法は干渉することがあります。}}
 
 
xcompmgr のドキュメントを確認してどのコンポジットオプションを有効にすべきか決めて下さい。以下は標準的なコマンドになります。
 
 
$ xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
 
 
{{ic|conky &}} で conky が実行中か確認してください。transset-df を使って Conky ウィンドウの透過を有効にします。'.5' は 0 - 1 の好きな値に設定してください。
 
 
$ transset-df .5 -n Conky
 
 
これで conky のウィンドウが完全透過します。{{ic|No Window matching Conky exists!}} のようなエラーが表示される場合、conky が動作しているか確認してから、xprop を使って conky のウィンドウをクリックして、{{ic|transset-df}} に指定するべき名前を確認してください。
 
{{hc|$ xprop &#124; grep WM_NAME|2=WM_NAME(STRING) = "Conky (ArchitectLinux)"}}
 
 
上記の場合、''conky'' で合っていますが、別の文字列が出力された場合は、それに合わせて指定するようにしてください。{{ic|conky.conf}} で {{ic|own_window_type}} オプションを {{ic|panel}} に設定していた場合、''xprop'' を実行しても何も出力されないことがあります。その場合は {{ic|dock}}, {{ic|normal}}, {{ic|override}}, {{ic|desktop}} などを使うようにしてみてください。
 
 
{{ic|~/.xinitrc}} に以下を記述することで [[Xorg|X]] の起動後に ''conky'' に透過を適用することができます:
 
 
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
 
conky -d; sleep 1 && transset-df .5 -n Conky
 
   
 
== 参照 ==
 
== 参照 ==
428行目: 213行目:
 
* [http://conky.sourceforge.net/variables.html Conky オブジェクト]
 
* [http://conky.sourceforge.net/variables.html Conky オブジェクト]
 
* [https://bbs.archlinux.org/viewtopic.php?id=39906 Arch フォーラムの Conky 設定スレッド]
 
* [https://bbs.archlinux.org/viewtopic.php?id=39906 Arch フォーラムの Conky 設定スレッド]
* [http://freecode.com/projects/conky/ Conky] on [[wikipedia:Freecode|Freecode]]
+
* [https://github.com/brndnmtthws/conky/wiki/FAQ FAQ]
* [irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:Freenode|freenode]]
 
* [http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ]
 

2024年4月19日 (金) 01:45時点における版

関連記事

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

参照