如何在登录屏幕添加或操作应用程序/系统指标?

如何在登录屏幕添加或操作应用程序/系统指标?

我想删除通常出现在登录屏幕右上角的几个指示器。特别是,我想删除辅助功能、键盘布局、电源和声音指示器,尽管知道如何添加或删除指示器会很好。我该怎么做?

答案1

我在 Ubuntu 14.04 中尝试过的一种方法是使用 LightDM(默认);使用存储在/usr/share/unity/indicators/

假设您想隐藏键盘指示器:

  1. 打开相应文件进行编辑

    sudo nano /usr/share/unity/indicators/com.canonical.indicator.keyboard
    
  2. 注释您想要隐藏的模式的对象路径,例如这将隐藏在问候屏幕和锁定屏幕中

    [Indicator Service]
    Name=indicator-keyboard
    ObjectPath=/com/canonical/indicator/keyboard
    Position=80
    
    [desktop]
    ObjectPath=/com/canonical/indicator/keyboard/desktop
    
    #[desktop_greeter]
    #ObjectPath=/com/canonical/indicator/keyboard/desktop_greeter
    
    #[desktop_lockscreen]
    #ObjectPath=/com/canonical/indicator/keyboard/desktop_lockscreen
    
    [ubiquity]
    ObjectPath=/com/canonical/indicator/keyboard/desktop
    
  3. 重新启动或仅重新启动显示管理器

    sudo service lightdm restart
    

答案2

采用不同的方法:

$ pstree
init─┬─...
     ├─lightdm─┬─Xorg
     │         ├─lightdm─┬─lightdm-greeter───unity-greeter───4*[{unity-greeter}]
     ...

$ dpkg -L unity-greeter
...
/usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml
...

$ more /usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml

...
    <key name="indicators" type="as">
      <default>['ug-accessibility', 'com.canonical.indicator.keyboard', 'com.canonical.indicator.session', 'com.canonical.indicator.datetime', 'com.canonical.indicator.
power', 'com.canonical.indicator.sound', 'application']</default>
      <summary>Which indicators to load</summary>
    </key>
...

unity-greeter由用户运行lightdm!我不用四处寻找方法来更改dconf该幽灵用户的设置。我覆盖了默认值。在 Ubuntu 14.04 64 位 (VirtualBox) 中测试。

  1. 创建新的dconf覆盖文件

    sudo nano /usr/share/glib-2.0/schemas/90_unity-greeter.gschema.override
    

    将以下两行内容放入您想要保留的指标中:

    [com.canonical.unity-greeter]
    indicators=['com.canonical.indicator.session']
    

    默认值为:

    ['ug-accessibility', 'com.canonical.indicator.keyboard', 'com.canonical.indicator.session', 'com.canonical.indicator.datetime', 'com.canonical.indicator.power', 'com.canonical.indicator.sound', 'application']
    
  2. 重新编译glib架构

    sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
    
  3. 重新启动显示管理器

    sudo service lightdm restart
    

相关内容