Ubuntu – How to remove the network manager applet from the GNOME Flashback session

19.10autostartgnome-flashbackindicatornetwork-manager

The title says it all. I don't want that applet because when I'm in an environment where wifi is of poor quality, it has the very annoying tendency to popup windows that interrupt other activities, such as playing games full screen. My network manager configuration is OK, thank you nm-applet, so shut up, please.

My current solution is to kill the nm-applet process. This isn't good practice however, and should not start in the first place. I could remove the package too, but it's not a good solution either since I still may want to use it sometimes, and uninstalling/reinstalling each and every time is really ugly, as well as fiddling with the package files such as clearing the execute bit or renaming, which makes for a package-inconsistent install.

I've tried copying /etc/xdg/autostart/nm-applet.desktop to ~/.config/autostart, and :

  • Setting NotShowIn=KDE;GNOME;GNOME-Flashback; => no luck
  • Setting X-GNOME-Autostart-enabled=false => no luck
  • ln -s /dev/null ~/.config/autostart/nm-applet.desktop => no luck

Hence my guess is, it's not started from /etc/xdg/autostart.

I tried gsettings set org.gnome.nm-applet show-applet false, no luck either. I thought it was very much self-explanatory and would work, but no.

To be more precise, I use the session that's named GNOME Flashback (Metacity) in the GDM login screen.

Any advices ? Is it hardcoded or what ?

SOLVED :

Thanks to the answer below, I found the file is indeed in the autostart directory, but not the one I was looking. However, rather that modifying the file itself, I copied it in ~/.config/autostart and appended X-GNOME-Autostart-enabled=false. The answerer's method applies system-wide, and my method works for the current user only.

Best Answer

for system-wide:

Please note the valuable comments from Experts

You should not edit files directly inside /etc/xdg/autostart directory by hand. It is a bad idea, bad method and bad recommendation. It will be overwritten on next package update. Instead - copy this file to ~/.config/autostart and then edit it for your needs. Or use GNOME GUI tool for startup applications (gnome-session-properties).

Open the file gnome-flashback-nm-applet.desktop with below command

sudo -H gedit /etc/xdg/autostart/gnome-flashback-nm-applet.desktop

and edit the content like below

[Desktop Entry]
Name=Network (GNOME Flashback)
Comment=Manage your network connections
# TRANSLATORS: Don't translate this text (this is icon name)
Icon=nm-device-wireless
Exec=nm-applet
TryExec=nm-applet
Terminal=false
Type=Application
NoDisplay=true
OnlyShowIn=noGNOME-Flashback; ### I have changed this line. ###
X-GNOME-UsesNotifications=true
X-Ubuntu-Gettext-Domain=gnome-flashback

for user only:

cp /etc/xdg/autostart/gnome-flashback-nm-applet.desktop ~/.config/autostart/

and edit the file ~/.config/autostart/gnome-flashback-nm-applet like below

[Desktop Entry]
Name=Network (GNOME Flashback)
Comment=Manage your network connections
# TRANSLATORS: Don't translate this text (this is icon name)
Icon=nm-device-wireless
Exec=nm-applet
TryExec=nm-applet
Terminal=false
Type=Application
NoDisplay=true
OnlyShowIn=noGNOME-Flashback; ### I have changed this line. ###
X-GNOME-UsesNotifications=true
X-Ubuntu-Gettext-Domain=gnome-flashback

enter image description here

enter image description here

Related Question