Ubuntu 14.04には現在、右上隅にこれらのインジケーターのシャットダウン、ロックボタン、カレンダー時間の詳細、バッテリーの詳細、入力形式(英語)がデフォルトのインジケーターとしてあります。これらのデフォルトのインジケーターの1つとしてindicator-sysmonitorを作成することは可能ですか。
これで、コンピューターにログインしたときにのみ、indicator-sysmonitorが表示され、コンピューターからログアウトまたはロックすると、indicator-sysmonitorが自動的にパネルから終了します。ロックされたコンピューターのインジケーターの経験から知っています-sysmonitorはバックグラウンドで動作しますが、パネルには表示されません。コンピューターをロックしたときに表示したい統計情報(CPU、メモリ、カスタムを含む)があります。
できますか?
P.S.私はメインのソフトウェアサイトでこの質問をしましたが、作者はこのサイトを推奨しました。
私はこの質問とその回答を見てきましたが、有望に見えますが、indicator-sysmonitorに回答を適合させる方法がわかりません。
承認された回答:
グリーター/ログイン画面
nm-applet
動作します。 unity-greeter
にハードコーディングされているように見えるので、追跡しました。 。
この変更により、起動またはログオフ後にグリーティング画面に表示されます(ただし、ロック画面には表示されません)。
-
ソースをダウンロードして依存関係を構築する
sudo apt-get build-dep unity-greeter apt-get source unity-greeter
-
indicator-sysmonitor
のスポーン関数を追加しますcd unity-greeter-*/ vim src/unity-greeter.vala +590
そこに
もProcess.spawn_command_line_async ("nm-applet");
があります。nm-applet
を生成する元のコード グリーター画面用。完全なtry..catch
を使用してコピーを作成します ラップして変更し、indicator-sysmonitor
を生成します/* Make nm-applet hide items the user does not have permissions to interact with */ Environment.set_variable ("NM_APPLET_HIDE_POLICY_ITEMS", "1", true); try { Process.spawn_command_line_async ("nm-applet"); } catch (Error e) { warning ("Error starting nm-applet: %s", e.message); } /* I added these for sysmonitor, from here */ try { Process.spawn_command_line_async ("indicator-sysmonitor"); } catch (Error e) { warning ("Error starting indicator-sysmonitor: %s", e.message); } /* to here */ }
-
ビルド
./autogen.sh ./configure --prefix=/usr make -j2
-
インストール
sudo cp src/unity-greeter /usr/local/sbin/unity-greeter
-
再起動
ロック画面
とにかく、これはすべてのアプリケーションインジケータ(スクリーンショットのnm-appletに注意)を表示します。これはセキュリティとプライバシーの欠点である可能性があります。ロック画面モードのインジケーターリストのみを事前に定義することは可能ですが、そうしてテストする時間がありません。
-
ソースをダウンロードして依存関係を構築する
sudo apt-get build-dep unity apt-get source unity
-
unity-panel-serviceを変更して、ロック画面モードでもアプリケーションインジケーターをロードします。
cd unity-7*/ vim services/panel-service.c +893
if (!lockscreen_mode)
以下は、ロック画面モードでインジケーターが読み込まれないようにします。static void initial_load_default_or_custom_indicators (PanelService *self, GList *indicators) { GList *l; suppress_signals = TRUE; if (!indicators) { /* comment these lines if (!lockscreen_mode) { load_indicators (self); } */ // add this line load_indicators (self); load_indicators_from_indicator_files (self); sort_indicators (self); } ...
-
ビルド
mkdir build cd build/ cmake ../ make
-
インストール
sudo mv /usr/lib/unity/unity-panel-service /usr/lib/unity/unity-panel-service.orig sudo cp services/unity-panel-service /usr/lib/unity/unity-panel-service
試してみてください: Ctrl Alt L