为...添加生成功能 indicator-sysmonitor
cd unity-greeter-*/
vim src/unity-greeter.vala +590
您可以Process.spawn_command_line_async ("nm-applet");在其中找到原始代码,该代码会nm-applet为greeter屏幕生成。使用完全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 */
}