
Ubuntu 14.04には現在、右上隅にシャットダウン、ロックボタン、カレンダー時間の詳細、バッテリーの詳細、入力形式(英語)のインジケーターがデフォルトのインジケーターとして表示されています。インジケータ-sysmonitorデフォルトの指標の 1 つとして。
コンピュータにログインしているときのみ、indicator-sysmonitor が表示され、ログアウトまたはコンピュータをロックすると、indicator-sysmonitor はパネルから自動的に終了します。ロックされたコンピュータでの経験から、indicator-sysmonitor はバックグラウンドで動作しますが、パネルには表示されないことがわかっています。コンピュータをロックしたときに表示したい統計情報 (CPU、メモリ、カスタムなど) がいくつかあります。
それはできるでしょうか?
PS: この質問をメインのソフトウェアサイトで尋ねたところ、著者がこのサイトを勧めてくれました。
私は見てきましたこの質問そしてその答えは有望に見えますが、indicator-sysmonitor の答えをどのように適応させるかはわかりません。
答え1
挨拶/ログイン画面
最終的に、 がどのように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
それを試してみてください:CtrlAltL