如何在登录屏幕上将indicator-sysmonitor设置为默认指示器


10

当前,Ubuntu 14.04在这些指示器的右上角具有关闭,锁定按钮,日历时间详细信息,电池详细信息,输入格式(英语)作为默认指示器。是否有可能使indicator-sysmonitor成为那些默认指标之一。

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

能做到吗

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


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

Answers:


18

迎宾/登录屏幕

我最终看了如何nm-applet工作。我跟踪了它,因为它似乎很难编码unity-greeter

此修改使其在引导或注销后显示在问候语屏幕中(但不在锁定屏幕中)。

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

    sudo apt-get build-dep unity-greeter
    apt-get source unity-greeter
    
  2. 为...添加生成功能 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 */
    
    }
    
  3. 建立

    ./autogen.sh
    ./configure --prefix=/usr
    make -j2
    
  4. 安装

    sudo cp src/unity-greeter /usr/local/sbin/unity-greeter
    
  5. 重启

    单位欢迎程序上的指标系统监视器(Ubuntu问候屏幕)


锁屏

无论如何,这将显示所有应用程序指示器(在屏幕快照中注意nm-applet),这可能是安全和隐私方面的缺陷。可以仅针对锁屏模式预定义指标列表,我只是没有时间进行测试。

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

    sudo apt-get build-dep unity
    apt-get source unity
    
  2. 修改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);
        }
    ...
    
  3. 建立

    mkdir build
    cd build/
    cmake ../
    make
    
  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
    

    试试看: CtrlAltL

    lightdm锁定屏幕上的指标系统监视器


迟来的+1。有了Unity DE的迟疑,我想知道Ubuntu 18.04下的GDM是否会更容易?
WinEunuuchs2Unix
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.