How do I add or manipulate Application/System Indicators in the login screen?

I would like to remove several of the Indicators that usually appear in the upper-right-hand side of the login screen. In particular, I would like to remove the accessibility, keyboard layout, power, and sound indicators, although it would be nice to know how to generically add or remove indicators. How can I do this?


One way that I have tried in Ubuntu 14.04 using LightDM (Default); Using Some config files stored in /usr/share/unity/indicators/

Let's say you want to hide keyboard indicator:

  1. Open corresponding file for editing

    sudo nano /usr/share/unity/indicators/com.canonical.indicator.keyboard
    
  2. Comment object paths for the mode you want to hide in, example this will hide it in the greeting screen and lock screen

    [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. Reboot or just restart display manager

    sudo service lightdm restart
    

Coming with different approach:

$ 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 is run by lightdm user! Instead of looking around for a way to change the dconf setting for that ghost user. I override the default. Tested in Ubuntu 14.04 64bit (VirtualBox).

  1. Create new dconf override file

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

    Put these two lines in it with indicator you want to keep:

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

    Default is:

    ['ug-accessibility', 'com.canonical.indicator.keyboard', 'com.canonical.indicator.session', 'com.canonical.indicator.datetime', 'com.canonical.indicator.power', 'com.canonical.indicator.sound', 'application']
    
  2. Recompile glib schemas

    sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
    
  3. Restart the display manager

    sudo service lightdm restart