The default WiFi network connection tool on Ubuntu/Xubuntu is NetworkManager, which does a pretty poor job. I’ve been using Wicd as a replacement for about six months, and it’s a lot better, despite a few significant bugs (that have now been fixed in the codebase, if not in the currently released version).

However, I find on my EeePC, running Xubuntu Hardy, that Wicd 1.4.2 doesn’t reliably reconnect automatically to known networks after waking from sleep.

Wicd installs a script to run when the computer wakes from sleep in /etc/acpi/resume.d/80-wicd-connect.sh with this content:

#!/bin/sh
# Bring wifi network interface back up.

/opt/wicd/autoconnect.py

Unfortunately, autoconnect.py doesn’t. My hypothesis is that the driver for the wireless gets unloaded on suspend and reloaded on resume, and the pre-existing Wicd process can no longer talk to whatever it was previously talking to. So I decided to restart Wicd, too.

I changed /etc/acpi/resume.d/80-wicd-connect.sh to this:

#!/bin/sh
# Bring wifi network interface back up.

#/opt/wicd/autoconnect.py
/etc/init.d/wicd start

... and added a new file in /etc/acpi/suspend.d/80-wicd-stop.sh thus:

#!/bin/sh
# Stop Wicd to restart after resume

/etc/init.d/wicd stop

... which I made executable:

sudo chmod a+x /etc/acpi/suspend.d/80-wicd-stop.sh

And it seems to be reconnecting much more reliably so far, touch wood.