如何使指标系统监视器作为登录屏幕上的默认指标

pot*_*day 10 indicator unity lightdm

Ubuntu 14.04 目前在右上角有这些指标关机,锁定按钮,日历时间详细信息,电池详细信息,输入格式(英文)作为默认指标。是否可以将指标系统监视器作为这些默认指标之一。

现在发生的情况是,只有当我们登录计算机时,才会显示指标系统监视器,当您注销或锁定我们的计算机时,指标系统监视器会自动退出面板。我从锁定计算机的经验中知道指标系统监视器在后台工作但不会显示在面板中。我有一些统计信息(包括 cpu、mem 和一些自定义),我想在我锁定计算机时查看它们。

可以做到吗?

PS 我在主软件站点上问过这个问题,作者推荐了这个站点。


我看过这个问题及其答案,看起来很有希望 - 但我不知道如何调整指标系统监视器的答案。

use*_*.dz 18

迎宾/登录屏幕

我最终看看它是如何nm-applet工作的。我找到了它,因为它似乎是用unity-greeter.

此修改使其在启动或注销后出现在问候屏幕中(但不在锁定屏幕中)。

  1. 下载源代码并构建依赖项

    sudo apt-get build-dep unity-greeter
    apt-get source unity-greeter
    
    Run Code Online (Sandbox Code Playgroud)
  2. indicator-sysmonitor

    cd unity-greeter-*/
    vim src/unity-greeter.vala +590
    
    Run Code Online (Sandbox Code Playgroud)

    在那里您可以找到为欢迎屏幕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 */
    
    }
    
    Run Code Online (Sandbox Code Playgroud)
  3. 建造

    ./autogen.sh
    ./configure --prefix=/usr
    make -j2
    
    Run Code Online (Sandbox Code Playgroud)
  4. 安装

    sudo cp src/unity-greeter /usr/local/sbin/unity-greeter
    
    Run Code Online (Sandbox Code Playgroud)
  5. 重启

    unity-greeter 上的 indicator-sysmonitor(Ubuntu 问候屏幕)


锁屏

无论如何,这将显示所有应用程序指标(注意屏幕截图中的 nm-applet),这可能是安全和隐私方面的缺陷。可以只为锁屏模式预先定义一个指标列表,我只是没有时间这样做并测试它。

  1. 下载源代码并构建依赖项

    sudo apt-get build-dep unity
    apt-get source unity
    
    Run Code Online (Sandbox Code Playgroud)
  2. 修改 unity-panel-service 以加载应用程序指示器,即使在锁屏模式下也是如此。

    cd unity-7*/
    vim services/panel-service.c +893
    
    Run Code Online (Sandbox Code Playgroud)

    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);
        }
    ...
    
    Run Code Online (Sandbox Code Playgroud)
  3. 建造

    mkdir build
    cd build/
    cmake ../
    make
    
    Run Code Online (Sandbox Code Playgroud)
  4. 安装

    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
    
    Run Code Online (Sandbox Code Playgroud)

    尝试一下: CtrlAltL

    lightdm 锁屏上的指示灯系统监视器