How to make indicator-sysmonitor as a default indicator on the login screen
The Ubuntu 14.04 currently have at the top right corner these indicators shutdown,lock button, calender time details, battery details, Input format (English) as the default indicators. Is it possible to make indicator-sysmonitor as one of those default indicators.
Now what happens is only when we logged into a computer, indicator-sysmonitor will be shown and when you log out or lock our computer indicator-sysmonitor will automatically exit from panel. I know from experience in locked computers indicator-sysmonitor works in the background but will not show in the panel. I have some stats (includes cpu,mem and some custom) which i want to see when i lock my computer.
can it be done?
P.S. I have asked this question in the main software site and the author recommended this site.
I've looked at this Question and its answers and it looks promising - but I don't know how to adapt the answers for indicator-sysmonitor.
Solution 1:
Greeter/Login Screen
I end up looking how the nm-applet
works. I tracked it down, as it seems hard coded in unity-greeter
.
This modification make it appear in the greeting screen after boot or logoff (but not in the lock screen).
-
Download source and build dependencies
sudo apt-get build-dep unity-greeter apt-get source unity-greeter
-
Add spawn function for
indicator-sysmonitor
cd unity-greeter-*/ vim src/unity-greeter.vala +590
There you find
Process.spawn_command_line_async ("nm-applet");
in original code which spawn thenm-applet
for the greeter screen. Make a copy of it with the fulltry..catch
wrap and modify it to spawnindicator-sysmonitor
too./* 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 */ }
-
Build
./autogen.sh ./configure --prefix=/usr make -j2
-
Install
sudo cp src/unity-greeter /usr/local/sbin/unity-greeter
-
Reboot
Lock Screen
Anyway, this will show all application indicators (notice nm-applet in the screenshot), this may be a security & privacy drawback. It is possible to pre-define an indicator list for lockscreen mode only, I just don't have time to do so and test it.
-
Download source and build dependencies
sudo apt-get build-dep unity apt-get source unity
-
Modify unity-panel-service to load application indicators even in lockscreen-mode.
cd unity-7*/ vim services/panel-service.c +893
if (!lockscreen_mode)
below prevent loading indicators in lock screen 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); } ...
-
Build
mkdir build cd build/ cmake ../ make
-
Install
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
Try it: CtrlAltL