nm-applet problems with (X)Ubuntu 7.04

Following on from the fun I’ve been having getting wireless cards working under Ubuntu (or Linux in general for that matter) I found a bit of a glitch in the 7.04 install I’m running on my laptop. So a matter of days before the release of 7.10 I’m beating 7.04 into submission! The story goes a little like this:

After using a pretty standard Ubuntu install with Gnome for a while I decided to switch back to my preferred XFCE desktop. This was fairly straightforward, although the xubuntu-desktop package pulled in a few things I didn’t want, so I used it to populate the new install list (in Synaptic) and then trimmed the packages I didn’t want (mainly the office applications since I prefer to stick with OpenOffice). One thing I noted after making the switch back was that there was no Network Manager applet running, and a quick check of the package details seemed to indicate that it was part of Gnome, so I decided to look elsewhere for an equivalent. I experimented briefly with Wicd, but whilst doing that I found out that, although Network Manager is part of Gnome it is pretty free of Gnome dependencies and is largely independent, so I decided to switch back. Having done that I needed to look for a way of getting the applet running. This seemed simple enough, I just needed to add an entry into the Autostarted applications list as accessed from Applications -> Settings. Having done this all seemed well until, after a few reboots I noticed that I had multiple copies of the nm-applet in the panel – oops!

After a bit of digging around my file system in directories like /etc and ~/.config with the grep command I finally came up with some likely files, mainly /etc/xdg/autostart/nm-applet.desktop. Then with a bit of help from Google I came up with a couple of good references, mainly a bug report for Ubuntu [1], a reference on the Ubuntu forums [2] and another discussion linked from there [3]. With the aid of those and a bit of experimentation I came up with the following fix:

  1. First off I got rid of all the nm-applet instances running with pkill nm-applet
  2. Next I got rid of my hand installed autostart entry for the nm-applet, so to do this I deleted the file ~/.config/autostart/nm-applet.desktop
  3. Then I made an edit to the system wide autostart entry for nm-applet, for this I need to change a line in the /etc/xdg/autostart/nm-applet.desktop
    file from OnlyShowIn=GNOME; to OnlyShowIn=GNOME;XFCE;. This lets the nm-applet configuration show in the Autostarted applications utility when you’re running XFCE.
  4. Finally I needed to clear out any information relating to nm-applet in the cached sessions. This was a case of editing two files in the ~/.cache/sessions/ directory.
    • These were xfce4-session-dusky:0 and xfce4-session-dusky:0.bak dusky is the name of my machine, so your files will have your machine name instead).
    • These files have a number of lines, the majority of which are grouped with the prefix Client0, Client1, etc., so I looked for the groups with an entry for CloneCommand of nm-applet and removed the groups.
    • I then had to renumber the Client groups so they were consecutive again starting at 0 and amend the Count entry towards the end of the file to match the number of groups I had (so one more than the last number used, remembering that you started at 0!).
  5. After the editing I could perform a reboot to confirm that all was well. I actually did a few of these, firstly with the Save session for future logins disabled to ensure that any cache information was completely clear. Next was another with the session disabled, just to be sure, and then one with
    it enabled again.

All now appears fine with just a single nm-applet on my panel.

[1] https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/95064
[2] http://ubuntuforums.org/archive/index.php/t-191708.html
[3] http://www.nabble.com/Multiple-Instances-of-nm-applet-t4114321.html

Leave a Comment

Your email address will not be published. Required fields are marked *