「Conky」の版間の差分
細 |
(同期) |
||
| (4人の利用者による、間の17版が非表示) | |||
| 1行目: | 1行目: | ||
| − | [[Category: |
+ | [[Category:システムモニタ]] |
| + | [[de:Conky]] |
||
[[en:Conky]] |
[[en:Conky]] |
||
| − | [[es:Conky]] |
||
[[fr:Conky]] |
[[fr:Conky]] |
||
| − | [[ |
+ | [[zh-hans:Conky]] |
| + | {{Related articles start}} |
||
| − | [[ru:Conky]] |
||
| + | {{Related|Conky/ヒントとテクニック}} |
||
| − | [[tr:Conky]] |
||
| + | {{Related|Lm_sensors}} |
||
| − | [[zh-CN:Conky]] |
||
| + | {{Related|Hddtemp}} |
||
| − | Conky は X Windows System 向けのシステム監視ソフトウェアです。GNU/Linux と FreeBSD で利用することができます。GPL ライセンスでリリースされているフリーソフトウェアになります。CPU, メモリー, スワップ, ディスク容量, 温度, top, アップロード, ダウンロード, システムメッセージなど、様々なシステムの情報を Conky はモニターすることが可能です。色々と設定することができますが、設定は少々わかりにくいかもしれません。Conky は torsmo のフォークです。 |
||
| + | {{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}} パッケージを[[pacman|インストール]]。 |
||
| − | {{Note|このパッケージに lua のサポートは含まれていません。[[#AUR パッケージ]]を参照。}} |
||
| − | * [http://conky.sourceforge.net/screenshots.html homeproject-screenshot] のサンプル設定ファイルを使って {{ic|~/.conkyrc}} 設定ファイルを編集。 |
||
| − | 設定ファイルの編集時、ファイルを保存すればすぐに変更が適用されます。X セッションをログアウト・ログインする必要はありません。なので、一つ一つ、全てのオプションを試してみて、設定ファイルを保存して conky ウィンドウがどう変化したか見て、望むようになるまで修正するのが良いでしょう。 |
||
| − | * また、{{ic|/etc/conky/conky.conf}} のデフォルト設定を使うこともできます: |
||
| − | $ conky -C > ~/.config/conky/conky.conf |
||
| − | ローカルの {{ic|~/.conkyrc}} 設定ファイルを使うのがベストです。多くのアプリと同じように、conky もまず最初にローカルの {{ic|.conkyrc}} ファイルがあるか確認します。ファイルが存在しない場合、デフォルトの設定が読み込まれます。 |
||
| + | {{Pkg|conky}} パッケージを [[インストール]] します。追加のコンパイルオプションを有効にしてインストールできる代替パッケージもあります。 |
||
| − | 設定をローカル (例: ホームディレクトリ) に保存した場合、変更を行うまでログファイルを読めなくなります。conky の素晴らしい機能の一つとしてデスクトップに {{ic|/var/log/}} のファイルをパイプしてあらゆるログメッセージを読めるようにすることができます。これらのファイルのほとんどは {{ic|root}} しか読むことができないため、{{ic|sudo}} で conky を実行する必要がありますが conky を {{ic|root}} で起動するのはあまり推奨されません、以下の変更を行いましょう: |
||
| − | # usermod -aG log username |
||
| − | {{ic|username}} を {{ic|log}} グループに追加します。これで {{ic|username}} はログファイルを読むことができるようになり、conky でログメッセージをデスクトップにリダイレクトすることが可能です。 |
||
| + | * {{AUR|conky-cli}} - X11 依存関係のない conky |
||
| − | * {{ic|~/.conkyrc}} にした変更が conky に適用されない場合 -- 例: minimum_size -- {{ic|/etc/conky/conky.conf}} を削除するか関連するセクションをコメントアウトして下さい。conky は {{ic|/etc/conky/}} のファイルを読み込み続け Xorg のエラーメッセージが表示されることがあります、{{ic|/etc/conky/}} のファイルは削除すると良いでしょう。 |
||
| + | * {{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]] パッケージと変数の代わりとして使用できます。 |
||
| − | == AUR パッケージ == |
||
| + | 追加のユーティリティ: |
||
| − | 基本の '''conky''' パッケージに加えて、追加のコンパイルオプションを有効にした [[AUR]] のパッケージがいくつか存在します: |
||
| + | * {{App|Conky Manager|Conky ウィジェットのテーママネージャー。システムにインストールされている Conky テーマを開始/停止、参照、編集するためのオプションが提供されます。|https://teejeetech.com/conky-manager/|{{Pkg|conky-manager}}}} |
||
| + | == 設定 == |
||
| − | * {{App|conky-cli|X11 依存を取り除いた Conky||{{AUR|conky-cli}}}} |
||
| − | * {{App|conky-lua|Lua サポートが付いた Conky||{{AUR|conky-lua}}}} |
||
| − | * {{App|conky-lua-nv|Lua と Nvidia サポートが付いた Conky||{{AUR|conky-lua-nv}}}} |
||
| − | * {{App|conky-nvidia|Nvidia サポートが付いた Conky||{{AUR|conky-nvidia}}}} |
||
| + | 設定ファイルは、次のパスのいずれかにあります (最初に見つかったパスが使用されます): |
||
| − | == Tips and tricks == |
||
| + | * {{ic|~/.config/conky/conky.conf}} |
||
| − | === KDE4 や Xfce4 で完全透過を有効にする === |
||
| + | * {{ic|~/.conkyrc}} |
||
| + | * {{ic|/etc/conky/conky.conf}} |
||
| + | これらのファイルが存在しない場合、conky はデフォルトの組み込み設定を使用します。これは次のように出力できます: |
||
| − | バージョン 1.8.0 から、Conky は完全透過をサポートしています。有効にするには次の行を {{ic|~/.conkyrc}} に追加して下さい: |
||
| − | own_window_transparent yes |
||
| + | $ conky --print-config |
||
| − | 上のオプションは {{ic|OWN_WINDOW_ARGB_VISUAL yes}} オプションと一緒に使うのは望ましくありません。下で説明している {{Pkg|feh}} の方法を置き換えます。 |
||
| + | さらに、次のコマンドを使用してデフォルトの設定ファイルを作成できます: |
||
| − | {{Note|1=[[Xfce]] はコンポジットの有効化を必要とします。[https://forum.xfce.org/viewtopic.php?pid=25939] を見て下さい。}} |
||
| + | $ mkdir -p ~/.config/conky && conky --print-config > ~/.config/conky/conky.conf |
||
| − | === Xfce4 で自動起動 === |
||
| + | [[ドットファイル]] をホームディレクトリに置きたい場合は、別の場所にファイルを作成し、引数を使用してそれを使用するように conky に指示できます。 |
||
| − | {{ic|.conkyrc}} ファイルで: |
||
| − | background yes |
||
| + | たとえば、ユーザーのホームディレクトリにあるドットファイルを使用するように conky に指示するには: |
||
| − | この変数は Conky をバックグラウンドにフォークします。ウィンドウをデスクトップ上に常に表示させ、全てのワークスペースに張り付かせてタスクバーには表示したくない場合、以下の引数を追加してください: |
||
| − | own_window yes |
||
| − | own_window_type override |
||
| − | override オプションはウィンドウがウィンドウマネージャの制御下から外れるようにします。 |
||
| + | $ conky --config=~/.conky.conf |
||
| − | {{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 |
||
| + | 追加の設定ファイルの例は、[https://github.com/brndnmtthws/conky/wiki/Configs 上流の wiki 記事] で入手できます。 |
||
| − | === ちらつきを防止する === |
||
| + | conky の実行中に設定ファイルを編集すると、ファイルに書き込むたびに conky が新しい変更内容を更新します。 |
||
| − | 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'' は自動でロードされます。 |
||
| + | すべての Conky オブジェクト/変数の完全なリファレンスについては、[https://conky.sourceforge.net/variables.html SourceForge ページ] を参照してください。これらは {{man|1|conky}} にもリストされています。 |
||
| − | ダブルバッファリングを有効にするには {{ic|~/.conkyrc}} に {{ic|double_buffer yes}} オプションを追加してください。 |
||
| − | |||
| − | === カスタムカラー === |
||
| − | |||
| − | クラシックなプリセットカラーの他に (white, black, yellow...)、カラーネームコードを使ってカスタムカラーを設定することができます。色のコードを確認するには、色選択アプリを使って下さい。[[公式リポジトリ]]に入っている {{Pkg|gcolor2}} パッケージが色の名前を教えてくれます。カラーコードは6桁の16進数からなります (0-9, A-F)。カスタムカラーを使うには設定ファイルに以下の行を追加してください: |
||
| − | color1 Colorname1 |
||
| − | color2 Colorname2 |
||
| − | そして、{{ic|TEXT}} セクションを編集するときに、事前に定義したカスタムカラー番号を使って下さい。 |
||
=== デュアルスクリーン === |
=== デュアルスクリーン === |
||
| − | デュアルスクリーン設定を使 |
+ | デュアルスクリーン設定を使用する場合、''conky'' ウィンドウをデスクトップ上の希望の場所に配置するには、いくつかのオプションを調整する必要があります。 |
| − | alignment top_left |
||
| − | gap_X 840 |
||
| − | {{ic|alignment}} オプションはそのままの意味で、{{ic|gap_X}} オプションは画面の左端からの距離をピクセルで表します。 |
||
| + | 1680x1050 ピクセルの解像度を実行していて、ウィンドウを左モニターの中央上部に配置したい場合。{{ic|gap_x}} を調整して次のように使用します: |
||
| − | === デスクトップの表示で最小化させない === |
||
| + | alignment = 'top_left', |
||
| + | gap_x = 840, |
||
| + | {{ic|alignment}} オプションは一目瞭然で、{{ic|gap_X}} は画面の左端からの距離 (ピクセル単位) です。 |
||
| + | {{ic|xinerama_head}} は代替の便利なオプションです。次のようにすると、''conky''ウィンドウが 2 番目の画面の右上に配置されます。 |
||
| − | Compiz を使っている場合: 'デスクトップを表示' ボタンやキーバインドで、他のウィンドウと一緒に Conky も最小化されてしまう場合、Compiz の設定マネージャを起動して、"General Options" を開いて "Hide Skip Taskbar Windows" オプションのチェックを外して下さい。 |
||
| + | alignment = 'top_right', |
||
| + | xinerama_head = 2, |
||
| + | === 設定ファイルの構文 === |
||
| − | Compiz を使っていない場合は、{{ic|~/.conkyrc}} を編集して以下の行を追加または修正してください: |
||
| + | Conky 1.10 (2015Q2 頃) 以降、設定ファイルは次のような [[Lua]] 構文で記述されます。 |
||
| − | own_window_type override |
||
| + | conky.config = { |
||
| − | もしくは |
||
| + | -- Comments start with a double dash |
||
| + | bool_value = true, |
||
| + | string_value = 'foo', |
||
| + | int_value = 42, |
||
| + | } |
||
| + | conky.text = [[ |
||
| + | $variable |
||
| + | ${evaluated variable} |
||
| + | ]] |
||
| + | 1.10 より前では、次のような古い構文が使用されます。 |
||
| − | own_window_type desktop |
||
| + | bool_value yes |
||
| − | 詳しい違いについては conky の man ページを参照。ただし後者のオプションでは Openbos などでリサイズのキーバインドを使ってウィンドウを conky の縁に調整することができます。前者は出来ません。 |
||
| + | string_value 'foo' |
||
| + | int_value 42 |
||
| + | 古い構文から新しい Lua 構文に変換する Lua スクリプトが利用可能です [https://github.com/brndnmtthws/conky/blob/master/extras/convert.lua の GitHub リポジトリ] スクリプトは {{ic|/usr/share/doc/conky-1.15.0_pre/convert.lua}} にもあります。 |
||
| − | === Gnome 3 との統合 === |
||
| + | == フォント == |
||
| − | Gnome 3 で Conky を表示したときに問題が生じる場合。 |
||
| − | *以下の行を {{ic|~/.conkyrc}} に追加: |
||
| − | own_window yes |
||
| − | own_window_type conky |
||
| − | own_window_transparent yes |
||
| − | own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager |
||
| + | conky で Unicode の画像と絵文字を表示するには、これをサポートする [[フォント#絵文字と記号|フォント]] が必要で、表示したい Unicode のフォントを使用するように conky を設定します。例えば: |
||
| − | 透過に問題が起こる場合、以下の行を追加してみてください: |
||
| − | own_window_argb_visual yes |
||
| − | own_window_argb_value 255 |
||
| + | ${font Symbola:size=48}☺${font} |
||
| − | === KDE との統合 === |
||
| + | === 記号フォント === |
||
| − | スクリーンショット設定の Conky ではアイコンの視覚化に問題を生じさせます。以下の手順に従って下さい。 |
||
| − | * 以下の行を {{ic|~/.conkyrc}} に追加: |
||
| − | own_window yes |
||
| − | own_window_type normal |
||
| − | own_window_transparent yes |
||
| − | own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager |
||
| − | * 次の設定がオンになっている場合、コメントアウトするか行を削除する: |
||
| − | minimum_size |
||
| − | * Conky の起動を自動にするために、次のシンボリックリンクを作成: |
||
| − | ** KDE4: {{ic|$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink}} |
||
| − | ** KDE3: {{ic|$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink}} |
||
| − | * 公式リポジトリから入手できる {{Pkg|feh}} パッケージをインストール。 |
||
| − | * スクリプトを作成してデスクトップで透過ができるようにする。 |
||
| − | KDE4 では {{ic|~/.kde4/Autostart/fehconky}} を編集: |
||
| + | シンボリックフォントは、より装飾された conky 設定でもよく使用されます。最も人気のあるものには次のようなものがあります: |
||
| − | #!/bin/bash |
||
| − | feh --bg-scale "$(sed -n 's/wallpaper=//p' ~/.kde4/share/config/plasma-desktop-appletsrc)" |
||
| + | * {{Pkg|otf-font-awesome}} |
||
| − | KDE3 では {{ic|~/.kde/share/autostart/fehconky}} を編集: |
||
| + | * {{AUR|ttf-pizzadude-bullets}} - PizzaDude Bullet's font |
||
| + | * {{AUR|ttf-weather-icons}} - Erik flowers weather icon font with 222 glyphs |
||
| + | == 自動起動 == |
||
| − | #!/bin/bash |
||
| − | feh --bg-scale $(dcop kdesktop KBackgroundIface currentWallpaper 1) |
||
| + | [[自動起動]] で説明されているように、Conky を自動的に起動するにはいくつかの方法があります。 |
||
| − | 壁紙を中央に表示したい場合は {{ic|--bg-center}} を使う。 |
||
| + | Conky には、バックグラウンドにフォークするように指示する構成設定があります。これは、一部の自動起動セットアップでは望ましい場合があります。 |
||
| − | * 実行可能属性を付与: |
||
| − | ** KDE4: {{ic|$ chmod +x ~/.kde4/Autostart/fehconky}} |
||
| − | ** KDE3: {{ic|$ chmod +x ~/.kde/share/autostart/fehconky}} |
||
| − | * スクリプトを使うかわりに、{{ic|~/.conkyrc}} の一番下に同じ内容の行を追加することもできます。 |
||
| − | ** KDE4 の場合 {{ic|1=${exec feh --bg-scale "$(sed -n 's/wallpaper=//p' ~/.kde4/share/config/plasma-desktop-appletsrc)"} }} |
||
| − | ** KDE3 の場合 {{ic|1=${exec feh --bg-scale $(dcop kdesktop KBackgroundIface currentWallpaper 1)} }} |
||
| + | In {{ic|conky.conf}}: |
||
| − | === Razor-qt との統合 === |
||
| + | conky.config = { |
||
| − | |||
| + | background = true, |
||
| − | Conky のデフォルト設定では、後ろをクリックするとデスクトップからウィンドウが消えることがあります。以下の行を追加してください: |
||
| − | {{hc|~/.conkyrc|own_window yes |
||
| − | own_window_class Conky |
||
| − | own_window_type normal |
||
| − | own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager |
||
| − | own_window_transparent yes |
||
| − | }} |
||
| − | |||
| − | === パッケージの更新情報を表示 === |
||
| − | |||
| − | * [[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]] スクリプト。 |
||
| − | |||
| − | === 天気予報を表示 === |
||
| − | |||
| − | [https://bbs.archlinux.org/viewtopic.php?id=37381 このスレッド]を参照。 |
||
| − | |||
| − | === RSS フィードを表示 === |
||
| − | |||
| − | 外部のスクリプトを実行したり Conky に出力したりすることなく、RSS フィードをネイティブに表示する機能が Conky には備わっています。例えば、Planet Arch の最新の記事のタイトル10件を表示して一分ごとにフィードを更新したい場合、以下を {{ic|~/.conkyrc}} の {{ic|TEXT}} セクションに挿入します: |
||
| − | |||
| − | ${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 は表示するアイテムの数です。 |
||
| − | |||
| − | === Distrowatch の Arch Linux のランキングを表示 === |
||
| − | [https://bbs.archlinux.org/viewtopic.php?id=88779 このスレッド]を参照。 |
||
| − | |||
| − | === rTorrent の統計を表示 === |
||
| − | |||
| − | [https://bbs.archlinux.org/viewtopic.php?id=67304 このスレッド]を参照。 |
||
| − | |||
| − | === WordPress ブログの統計を表示 === |
||
| − | |||
| − | python で書かれた [http://evilshit.wordpress.com/2013/04/20/conkypress-a-wordpress-stats-visualization-tool-for-your-desktop/ ConkyPress] という名前の拡張を使うことで表示できます。 |
||
| − | |||
| − | === 新規メールの数を表示 (Gmail) === |
||
| − | |||
| − | どこかに {{ic|gmail.py}} という名前のファイルを作って (ここでは {{ic|~/.scripts/}} を使用) 以下の [[Python]] コードを入力してください: |
||
| − | |||
| − | {{hc|gmail.py|<nowiki> |
||
| − | #!/usr/bin/env python |
||
| − | |||
| − | from urllib.request import FancyURLopener |
||
| − | |||
| − | email = 'your email' # @gmail.com can be left out |
||
| − | password = 'your password' |
||
| − | |||
| − | url = 'https://%s:%s@mail.google.com/mail/feed/atom' % (email, password) |
||
| − | |||
| − | opener = FancyURLopener() |
||
| − | page = opener.open(url) |
||
| − | |||
| − | contents = page.read().decode('utf-8') |
||
| − | |||
| − | ifrom = contents.index('<fullcount>') + 11 |
||
| − | ito = contents.index('</fullcount>') |
||
| − | |||
| − | fullcount = contents[ifrom:ito] |
||
| − | |||
| − | print(fullcount + ' new') |
||
| − | </nowiki>}} |
||
| − | |||
| − | 以下のように Python の urllib を使うこともできます。 |
||
| − | |||
| − | {{hc|gmail.py|<nowiki> |
||
| − | #! /usr/bin/env python |
||
| − | |||
| − | import urllib.request |
||
| − | 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='New mail feed', |
||
| − | 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) |
||
| − | |||
| − | 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 |
||
| − | |||
| − | print(fullcount + ' new') |
||
| − | </nowiki>}} |
||
| − | |||
| − | 次の行を {{ic|~/.conkyrc}} に追加すれば、5分 (300秒) ごとに新しいメールがないか Gmail アカウントをチェックして表示するようになります: |
||
| − | ${execpi 300 python ~/.scripts/gmail.py} |
||
| − | |||
| − | ==== 他の方法 ==== |
||
| − | |||
| − | 同じやり方で {{ic|curl}}, {{ic|grep}}, {{ic|sed}} を使う方法: |
||
| − | |||
| − | <nowiki>$ curl -s -u '''email''':'''password''' https://mail.google.com/mail/feed/atom | grep fullcount | sed 's/<[^0-9]*>//g'</nowiki> |
||
| − | |||
| − | '''email''' と '''password''' はあなたのデータに置き換えて下さい。 |
||
| − | |||
| − | また、{{Pkg|stunnel}} パッケージの [http://www.stunnel.org/ stunnel] を使うこともできます。 |
||
| − | |||
| − | 以下の設定は [http://conky.sourceforge.net/faq.html Conky の FAQ] から引用しています。 |
||
| − | |||
| − | 以下のように {{ic|/etc/stunnel/stunnel.conf}} を編集して、{{ic|stunnel}} [[デーモン]]を起動: |
||
| − | # 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|~/.conkyrc}} だけです: |
||
| − | 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) === |
||
| − | |||
| − | Conky には IMAP アカウントのサポートが組み込まれていますが SSL はサポートしていません。[http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html このフォーラムへの投稿] にあるスクリプトを使うことで利用することができます。{{AUR|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.desktop}} ファイルを使用したい場合は、次を使用します: |
||
| − | {{ic|~/.conkyrc}} に次を追加: |
||
| − | ${execpi 300 ~/.conky/imap.pl} |
||
| − | ファイルの位置は適宜変更してください。 |
||
| + | {{hc|~/.config/autostart/conky.desktop|2= |
||
| − | Gmail を使う場合、アプリパスワードを [http://www.google.com/accounts/IssuedAuthSubTokens?hide_authsub=1 生成] する必要があります。 |
||
| + | [Desktop Entry] |
||
| + | Type=Application |
||
| + | Name=conky |
||
| + | Exec=conky --daemonize --pause=5 |
||
| + | StartupNotify=false |
||
| + | Terminal=false}} |
||
| + | {{ic|1=pause=5}} パラメータは、起動時に ''conky'' の描画を 5 秒間遅らせ、デスクトップがロードされて起動する時間が確保されるようにします。 |
||
| − | もしくは、上に書かれているように stunnel を使うこともできます: [[#他の方法]] |
||
| + | == トラブルシューティング == |
||
| − | === UTF-8 マルチバイト文字のスクロールの修正 === |
||
| + | これらは、conky に関して人々が抱えている既知の問題とその解決策です。 |
||
| − | 現在のバージョンの conky (1.9.0) には文字列ではなくバイト数によってスクロールするテキストが増えるというバグが存在し (http://sourceforge.net/p/conky/bugs/341/)、結果としてマルチバイト文字を含むテキストでスクロールが消えたり現れたりするということが起こります。このバグを修正するパッチをあてたパッケージが AUR に存在します: {{AUR|conky-utfscroll}}。 |
||
| + | === Conky が起動しても画面に何も表示されない === |
||
| − | == ユーザーによる設定例 == |
||
| + | まず、設定ファイルのテキスト変数に構文エラーがないか確認します。次に、ユーザーが設定ファイル内のすべてのコマンドを実行する権限を持っていること、および必要なパッケージがすべてインストールされていることを再確認します。 |
||
| − | === Graysky === |
||
| + | === 透明 === |
||
| − | [[https://raw.github.com/graysky2/configs/5fbe513918dfe8066f87e670108318464902afae/dotfiles/.conkyrc Here]] it is - modify to fit your system. Optimized for a quad core chip w/ several hdds (although one of them is not connected for this screenshot) and an nvidia graphics card. You can easily modify this to a dual or single core system with one or whatever number of hdds. |
||
| + | Conky は 2 つの異なるタイプの透明度をサポートしています。疑似透明性と実際の透明性には、[[Xorg#コンポジット|コンポジットマネージャー]] がインストールされて実行されている必要があります。実際の透明度を有効にし、コンポジットマネージャーを実行していない場合、conky はフォントや画像、背景の透明度が有効になっていてもアルファ透明になりません。 |
||
| − | === nvidia サポートのサンプルリングスクリプト === |
||
| + | ==== 擬似透明 ==== |
||
| − | {{bc|1= |
||
| − | # -- Conky settings -- # |
||
| − | background no |
||
| − | update_interval 1 |
||
| + | conky では擬似透明がデフォルトで有効になっています。疑似透明は、ルートウィンドウから背景画像をコピーし、関連するセクションを conky の背景として使用することで機能します。一部のウィンドウマネージャーは、背景の壁紙をルートウィンドウより上のレベルに設定しているため、conky の背景が灰色になる可能性があります。この問題を解決するには、手動で設定する必要があります。[[feh]] の例は次のとおりです: |
||
| − | cpu_avg_samples 2 |
||
| − | net_avg_samples 2 |
||
| + | In {{ic|~/.xinitrc}}: |
||
| − | override_utf8_locale yes |
||
| + | sleep 1 && feh --bg-center ~/background.png & |
||
| − | double_buffer yes |
||
| − | no_buffers yes |
||
| + | ==== 本当の透明性を有効にする ==== |
||
| − | text_buffer_size 2048 |
||
| − | imlib_cache_size 0 |
||
| + | 実際の透明性を有効にするには、[[Xorg#コンポジット|コンポジットマネージャー]] を実行し、次の行を conky.config 配列内の {{ic|.conkyrc}} に追加する必要があります。 |
||
| − | # -- Window specifications -- # |
||
| + | conky.config = { |
||
| − | own_window yes |
||
| + | own_window = true, |
||
| − | own_window_type normal |
||
| − | own_window_transparent |
+ | own_window_transparent = true, |
| + | own_window_argb_visual = true, |
||
| − | own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below |
||
| + | own_window_type = 'desktop', |
||
| + | } |
||
| + | ウィンドウの種類 "デスクトップ" が機能しない場合は、それを {{ic|normal}} に変更してみてください。それが機能しない場合は、代わりに他のオプション: {{ic|dock}}、{{ic|panel}}、または {{ic|override}} を試してください。 |
||
| − | border_inner_margin 0 |
||
| − | border_outer_margin 0 |
||
| + | {{Note|1=[[Xfce]] の場合、合成を有効にする必要があります。[https://forum.xfce.org/viewtopic.php?pid=25939] を参照してください。}} |
||
| − | minimum_size 320 800 |
||
| − | maximum_width 320 |
||
| + | ==== 半透明 ==== |
||
| − | alignment bottom_right |
||
| − | gap_x 0 |
||
| − | gap_y 0 |
||
| + | リアル透明モードで半透明を実現するには、conky 設定ファイルで次の設定を使用する必要があります: |
||
| − | # -- Graphics settings -- # |
||
| − | draw_shades no |
||
| − | draw_outline no |
||
| − | draw_borders no |
||
| − | draw_graph_borders yes |
||
| + | conky.config = { |
||
| − | # -- Text settings -- # |
||
| + | own_window = true, |
||
| − | use_xft yes |
||
| + | own_window_transparent = false, |
||
| − | xftfont MaiandraGD:size=24 |
||
| + | own_window_argb_visual = true, |
||
| − | xftalpha 0.4 |
||
| + | own_window_argb_value = 90, |
||
| + | own_window_type = 'desktop', |
||
| + | } |
||
| + | conky ウィンドウの透明度を下げるには、{{ic|own_window_argb_value}} の値を 255 に向かって増やすことができます。 |
||
| − | uppercase no |
||
| + | === Show Desktop で最小化しないようにする === |
||
| − | default_color 888888 |
||
| + | '''Compiz を使用:''' 'Show Desktop' ボタンまたはキーバインディングによって Conky が他のすべてのウィンドウとともに最小化される場合は、Compiz 構成設定マネージャーを起動し、"General Options" に移動し、"Hide Skip Taskbar Windows" のチェックを外します。 |
||
| − | # -- Lua Load -- # |
||
| − | lua_load ~/conky/lua/lua.lua |
||
| − | lua_draw_hook_pre ring_stats |
||
| + | '''XFCE を使用:''' デスクトップをクリックすると Conky が非表示になる場合は {{ic|conky.conf}} 内に {{ic|1=own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',}} を追加します。 |
||
| − | TEXT |
||
| − | ${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y} |
||
| + | '''その他の [[デスクトップ環境]]/[[ウィンドウマネージャ]]:''' の場合: conky.conf を編集し、次の行を追加/変更してみてください: |
||
| + | own_window_type = 'override', |
||
| + | もしくは |
||
| − | ${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M} |
||
| − | |||
| − | |||
| − | |||
| − | ${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime: |
||
| − | ${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime |
||
| − | ${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}% |
||
| − | ${goto 117}${cpu cpu1}% |
||
| − | ${goto 117}CPU |
||
| − | ${voffset 19}${goto 145}${memperc}% |
||
| − | ${goto 145}$swapperc% |
||
| − | ${goto 145}MEM |
||
| − | ${voffset 25}${goto 170}${nvidia gpufreq} |
||
| − | ${goto 170}${nvidia memfreq} |
||
| − | ${goto 170}GPU |
||
| − | ${voffset 27}${goto 198}${totaldown ppp0} |
||
| − | ${goto 198}${totalup ppp0} |
||
| − | ${goto 205}NET |
||
| − | ${voffset 21} |
||
| − | ${goto 222}${fs_used /home} |
||
| − | ${goto 230}DISK |
||
| − | }} |
||
| − | |||
| − | And the required lua.lua script: |
||
| − | |||
| − | {{bc|<nowiki> |
||
| − | --[[ |
||
| − | Ring Meters by londonali1010 (2009) |
||
| − | |||
| − | This script draws percentage meters as rings. It is fully customisable; all options are described in the script. |
||
| − | |||
| − | IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this does not happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error. |
||
| − | |||
| − | To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua): |
||
| − | lua_load ~/scripts/rings-v1.2.1.lua |
||
| − | lua_draw_hook_pre ring_stats |
||
| − | |||
| − | Changelog: |
||
| − | + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009) |
||
| − | + v1.2 -- Added option for the ending angle of the rings (07.10.2009) |
||
| − | + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009) |
||
| − | + v1.0 -- Original release (28.09.2009) |
||
| − | ]] |
||
| − | |||
| − | settings_table = { |
||
| − | { |
||
| − | -- Edit this table to customise your rings. |
||
| − | -- You can create more rings simply by adding more elements to settings_table. |
||
| − | -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'. |
||
| − | name='time', |
||
| − | -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''. |
||
| − | arg='%I.%M', |
||
| − | -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100. |
||
| − | max=12, |
||
| − | -- "bg_colour" is the colour of the base ring. |
||
| − | bg_colour=0x888888, |
||
| − | -- "bg_alpha" is the alpha value of the base ring. |
||
| − | bg_alpha=0.3, |
||
| − | -- "fg_colour" is the colour of the indicator part of the ring. |
||
| − | fg_colour=0x888888, |
||
| − | -- "fg_alpha" is the alpha value of the indicator part of the ring. |
||
| − | fg_alpha=0.5, |
||
| − | -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window. |
||
| − | x=191, y=145, |
||
| − | -- "radius" is the radius of the ring. |
||
| − | radius=32, |
||
| − | -- "thickness" is the thickness of the ring, centred around the radius. |
||
| − | thickness=4, |
||
| − | -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative. |
||
| − | start_angle=0, |
||
| − | -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. |
||
| − | end_angle=360 |
||
| − | }, |
||
| − | { |
||
| − | name='time', |
||
| − | arg='%M.%S', |
||
| − | max=60, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=191, y=145, |
||
| − | radius=37, |
||
| − | thickness=4, |
||
| − | start_angle=0, |
||
| − | end_angle=360 |
||
| − | }, |
||
| − | { |
||
| − | name='time', |
||
| − | arg='%S', |
||
| − | max=60, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=191, y=145, |
||
| − | radius=42, |
||
| − | thickness=4, |
||
| − | start_angle=0, |
||
| − | end_angle=360 |
||
| − | }, |
||
| − | { |
||
| − | name='cpu', |
||
| − | arg='cpu0', |
||
| − | max=100, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=140, y=300, |
||
| − | radius=26, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='cpu', |
||
| − | arg='cpu1', |
||
| − | max=100, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=140, y=300, |
||
| − | radius=20, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='memperc', |
||
| − | arg='', |
||
| − | max=100, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=170, y=350, |
||
| − | radius=26, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='swapperc', |
||
| − | arg='', |
||
| − | max=100, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=170, y=350, |
||
| − | radius=20, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='time', |
||
| − | arg='%d', |
||
| − | max=31, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=191, y=145, |
||
| − | radius=50, |
||
| − | thickness=5, |
||
| − | start_angle=-140, |
||
| − | end_angle=-30 |
||
| − | }, |
||
| − | { |
||
| − | name='time', |
||
| − | arg='%m', |
||
| − | max=12, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=191, y=145, |
||
| − | radius=50, |
||
| − | thickness=5, |
||
| − | start_angle=30, |
||
| − | end_angle=140 |
||
| − | }, |
||
| − | -- { |
||
| − | -- name='fs_used_perc', |
||
| − | -- arg='/', |
||
| − | -- max=100, |
||
| − | -- bg_colour=0x888888, |
||
| − | -- bg_alpha=0.3, |
||
| − | -- fg_colour=0x888888, |
||
| − | -- fg_alpha=0.5, |
||
| − | -- x=260, y=503, |
||
| − | -- radius=26, |
||
| − | -- thickness=5, |
||
| − | -- start_angle=-90, |
||
| − | -- end_angle=180 |
||
| − | -- }, |
||
| − | { |
||
| − | name='fs_used_perc', |
||
| − | arg='/home', |
||
| − | max=100, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=260, y=503, |
||
| − | radius=20, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='totalup', |
||
| − | arg='ppp0', |
||
| − | max=2, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=230, y=452, |
||
| − | radius=20, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='totaldown', |
||
| − | arg='ppp0', |
||
| − | max=2, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=230, y=452, |
||
| − | radius=26, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='nvidia', |
||
| − | arg='gpufreq', |
||
| − | max=475, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=200, y=401, |
||
| − | radius=26, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | { |
||
| − | name='nvidia', |
||
| − | arg='memfreq', |
||
| − | max=700, |
||
| − | bg_colour=0x888888, |
||
| − | bg_alpha=0.3, |
||
| − | fg_colour=0x888888, |
||
| − | fg_alpha=0.5, |
||
| − | x=200, y=401, |
||
| − | radius=20, |
||
| − | thickness=5, |
||
| − | start_angle=-90, |
||
| − | end_angle=180 |
||
| − | }, |
||
| − | } |
||
| − | |||
| − | require 'cairo' |
||
| − | |||
| − | function rgb_to_r_g_b(colour,alpha) |
||
| − | return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha |
||
| − | end |
||
| − | |||
| − | function draw_ring(cr,t,pt) |
||
| − | local w,h=conky_window.width,conky_window.height |
||
| − | |||
| − | local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle'] |
||
| − | local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha'] |
||
| − | |||
| − | local angle_0=sa*(2*math.pi/360)-math.pi/2 |
||
| − | local angle_f=ea*(2*math.pi/360)-math.pi/2 |
||
| − | local t_arc=t*(angle_f-angle_0) |
||
| − | |||
| − | -- Draw background ring |
||
| − | |||
| − | cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f) |
||
| − | cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga)) |
||
| − | cairo_set_line_width(cr,ring_w) |
||
| − | cairo_stroke(cr) |
||
| − | |||
| − | -- Draw indicator ring |
||
| − | |||
| − | cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc) |
||
| − | cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga)) |
||
| − | cairo_stroke(cr) |
||
| − | end |
||
| − | |||
| − | function conky_ring_stats() |
||
| − | local function setup_rings(cr,pt) |
||
| − | local str='' |
||
| − | local value=0 |
||
| − | |||
| − | str=string.format('${%s %s}',pt['name'],pt['arg']) |
||
| − | str=conky_parse(str) |
||
| − | |||
| − | value=tonumber(str) |
||
| − | if value == nil then value = 0 end |
||
| − | pct=value/pt['max'] |
||
| − | |||
| − | draw_ring(cr,pct,pt) |
||
| − | end |
||
| − | |||
| − | if conky_window==nil then return end |
||
| − | local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height) |
||
| − | |||
| − | local cr=cairo_create(cs) |
||
| − | |||
| − | local updates=conky_parse('${updates}') |
||
| − | update_num=tonumber(updates) |
||
| − | |||
| − | if update_num>5 then |
||
| − | for i in pairs(settings_table) do |
||
| − | setup_rings(cr,settings_table[i]) |
||
| − | end |
||
| − | end |
||
| − | end |
||
| − | </nowiki>}} |
||
| − | |||
| − | == 記号フォントに関する注意 == |
||
| − | |||
| − | 装飾がある {{ic|.conkyrc}} では大抵 PizzaDude Bullets と Pie Charts for Maps フォントを使っています。これらのフォントはそれぞれ {{AUR|ttf-pizzadude-bullets}} と {{AUR|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}} と {{Pkg|transset-df}} を[[インストール]]してください。 |
||
| + | own_window_type = 'desktop', |
||
| − | {{Note|他のコンポジットマネージャを使っている場合、この方法は干渉することがあります。}} |
||
| + | 正確な違いについては、{{man|1|conky}} [[man ページ]] を参照してください。ただし、後者のオプションを使用すると、Openbox などでサイズ変更キーバインドを使用してウィンドウを ''conky'' の境界線にスナップできますが、最初のオプションではできません。 |
||
| − | xcompmgr のドキュメントを確認してどのコンポジットオプションを有効にすべきか決めて下さい。以下は標準的なコマンドになります。 |
||
| + | === GNOME シェルとの統合 === |
||
| − | $ xcompmgr -c -t-5 -l-5 -r4.2 -o.55 & |
||
| + | [[GNOME]] の下に ''conky'' が表示されるという問題を経験した人もいます。 |
||
| − | {{ic|conky &}} で conky が実行中か確認してください。transset-df を使って Conky ウィンドウの透過を有効にします。'.5' は 0 - 1 の好きな値に設定してください。 |
||
| + | 次の行を {{ic|conky.conf}} に追加します: |
||
| − | $ transset-df .5 -n Conky |
||
| + | own_window = true, |
||
| + | own_window_type = 'desktop', |
||
| + | === ちらつきを防ぐ === |
||
| − | これで conky のウィンドウが完全透過します。{{ic|No Window matching Conky exists!}} のようなエラーが表示される場合、conky が動作しているか確認してから、xprop を使って conky のウィンドウをクリックして、{{ic|transset-df}} に指定するべき名前を確認してください。 |
||
| − | {{hc|$ xprop | grep WM_NAME|2=WM_NAME(STRING) = "Conky (ArchitectLinux)"}} |
||
| + | ''Conky'' は、ちらつきを防ぐために X サーバーからの Double Buffer Extension ''(DBE)'' サポートを必要とします。これがないとウィンドウを十分に高速に更新できないからです。これは、{{ic|/etc/X11/xorg.conf}} の [[Xorg]]、{{ic|"Module"}} セクションの {{ic|Load "dbe"}} 行で有効にできます。{{ic|xorg.conf}} ファイルは、特定の設定ファイルを含む {{ic|/etc/X11/xorg.conf.d}} に置き換えられました (1.8.x パッチ以降) ''DBE'' は、{{ic|/usr/lib/xorg/modules}} 内に存在する限り自動的にロードされます。ロードされたモジュールのリストは、{{ic|grep LoadModule /var/log/Xorg.0.log}} で確認できます。 |
||
| − | 上記の場合、''conky'' で合っていますが、別の文字列が出力された場合は、それに合わせて指定するようにしてください。{{ic|~/.conkyrc}} で {{ic|own_window_type}} オプションを {{ic|panel}} に設定していた場合、''xprop'' を実行しても何も出力されないことがあります。その場合は {{ic|dock}}, {{ic|normal}}, {{ic|override}}, {{ic|desktop}} などを使うようにしてみてください。 |
||
| + | ダブルバッファリングを有効にするには、{{ic|double_buffer}} オプションを {{ic|conky.conf}} に追加します。 |
||
| − | {{ic|~/.xinitrc}} に以下を記述することで [[Xorg|X]] の起動後に ''conky'' に透過を適用することができます: |
||
| + | conky.config = { |
||
| − | xcompmgr -c -t-5 -l-5 -r4.2 -o.55 & |
||
| + | double_buffer = true, |
||
| − | conky -d; sleep 1 && transset-df .5 -n Conky |
||
| + | } |
||
== 参照 == |
== 参照 == |
||
| + | * [https://github.com/brndnmtthws/conky 公式ウェブサイト] |
||
| − | * [http://conky.sourceforge.net/config_settings.html Official Conky variables for configuration] |
||
| + | * [http://conky.sourceforge.net/config_settings.html 設定に使用する Conky 変数] |
||
| − | * [https://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums] |
||
| − | * [http://conky.sourceforge.net/ |
+ | * [http://conky.sourceforge.net/variables.html Conky オブジェクト] |
| + | * [https://bbs.archlinux.org/viewtopic.php?id=39906 Arch フォーラムの Conky 設定スレッド] |
||
| − | * [http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:ja:Freshmeat|Freshmeat]] |
||
| + | * [https://github.com/brndnmtthws/conky/wiki/FAQ FAQ] |
||
| − | * [http://sourceforge.net/projects/conky/ Conky] on [[wikipedia:ja:SourceForge.net|SourceForge]] |
||
| − | * [irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:ja:Freenode|freenode]] |
||
| − | * [http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ] |
||
2024年4月19日 (金) 12:48時点における最新版
Conky は、X Window System 用のシステムモニターソフトウェアです (Wayland のサポートは 進行中です) GNU/Linux および FreeBSD で利用できます。これは、GPL ライセンスの条件に基づいてリリースされたフリーソフトウェアです。Conky は、CPU、メモリ、スワップ、ディスク容量、温度、トップ、アップロード、ダウンロード、システム メッセージなどを含む多くのシステム変数を監視できます。柔軟に設定可能ですが、設定を理解するのが少し難しい場合があります。Conky は torsmo のフォークです。
目次
インストール
conky パッケージを インストール します。追加のコンパイルオプションを有効にしてインストールできる代替パッケージもあります。
- conky-cliAUR - X11 依存関係のない conky
- conky-lua-nvAUR - Lua と Nvidia の両方をサポート
conky の一部の組み込み変数 (音楽の mpd など) を利用するには、追加のパッケージをインストールする必要があります。ハードドライブの温度については、カーネル 5.6 以降 drivetemp モジュールは hwmon を通じて SATA/SAS 温度を報告します。lm_sensors#S.M.A.R.T. ドライブの温度 の議論を参照してください。conky の観点からは、drivetemp は、その hwmon 変数を使用することで、hddtemp パッケージと変数の代わりとして使用できます。
追加のユーティリティ:
- Conky Manager — Conky ウィジェットのテーママネージャー。システムにインストールされている Conky テーマを開始/停止、参照、編集するためのオプションが提供されます。
設定
設定ファイルは、次のパスのいずれかにあります (最初に見つかったパスが使用されます):
~/.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 設定でもよく使用されます。最も人気のあるものには次のようなものがあります:
- otf-font-awesome
- ttf-pizzadude-bulletsAUR - PizzaDude Bullet's font
- ttf-weather-iconsAUR - Erik flowers weather icon font with 222 glyphs
自動起動
自動起動 で説明されているように、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 秒間遅らせ、デスクトップがロードされて起動する時間が確保されるようにします。
トラブルシューティング
これらは、conky に関して人々が抱えている既知の問題とその解決策です。
Conky が起動しても画面に何も表示されない
まず、設定ファイルのテキスト変数に構文エラーがないか確認します。次に、ユーザーが設定ファイル内のすべてのコマンドを実行する権限を持っていること、および必要なパッケージがすべてインストールされていることを再確認します。
透明
Conky は 2 つの異なるタイプの透明度をサポートしています。疑似透明性と実際の透明性には、コンポジットマネージャー がインストールされて実行されている必要があります。実際の透明度を有効にし、コンポジットマネージャーを実行していない場合、conky はフォントや画像、背景の透明度が有効になっていてもアルファ透明になりません。
擬似透明
conky では擬似透明がデフォルトで有効になっています。疑似透明は、ルートウィンドウから背景画像をコピーし、関連するセクションを conky の背景として使用することで機能します。一部のウィンドウマネージャーは、背景の壁紙をルートウィンドウより上のレベルに設定しているため、conky の背景が灰色になる可能性があります。この問題を解決するには、手動で設定する必要があります。feh の例は次のとおりです:
In ~/.xinitrc:
sleep 1 && feh --bg-center ~/background.png &
本当の透明性を有効にする
実際の透明性を有効にするには、コンポジットマネージャー を実行し、次の行を conky.config 配列内の .conkyrc に追加する必要があります。
conky.config = {
own_window = true,
own_window_transparent = true,
own_window_argb_visual = true,
own_window_type = 'desktop',
}
ウィンドウの種類 "デスクトップ" が機能しない場合は、それを normal に変更してみてください。それが機能しない場合は、代わりに他のオプション: dock、panel、または override を試してください。
半透明
リアル透明モードで半透明を実現するには、conky 設定ファイルで次の設定を使用する必要があります:
conky.config = {
own_window = true,
own_window_transparent = false,
own_window_argb_visual = true,
own_window_argb_value = 90,
own_window_type = 'desktop',
}
conky ウィンドウの透明度を下げるには、own_window_argb_value の値を 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 シェルとの統合
GNOME の下に conky が表示されるという問題を経験した人もいます。
次の行を conky.conf に追加します:
own_window = true, own_window_type = 'desktop',
ちらつきを防ぐ
Conky は、ちらつきを防ぐために X サーバーからの Double Buffer Extension (DBE) サポートを必要とします。これがないとウィンドウを十分に高速に更新できないからです。これは、/etc/X11/xorg.conf の Xorg、"Module" セクションの Load "dbe" 行で有効にできます。xorg.conf ファイルは、特定の設定ファイルを含む /etc/X11/xorg.conf.d に置き換えられました (1.8.x パッチ以降) DBE は、/usr/lib/xorg/modules 内に存在する限り自動的にロードされます。ロードされたモジュールのリストは、grep LoadModule /var/log/Xorg.0.log で確認できます。
ダブルバッファリングを有効にするには、double_buffer オプションを conky.conf に追加します。
conky.config = {
double_buffer = true,
}