diff -uNr gnome-applets-2.6.1-orig/configure.in gnome-applets-2.6.1/configure.in
--- gnome-applets-2.6.1-orig/configure.in	2004-04-27 15:20:08.000000000 +0200
+++ gnome-applets-2.6.1/configure.in	2004-06-28 22:42:46.215797454 +0200
@@ -229,6 +229,15 @@
 AM_CONDITIONAL(NEED_LIBAPM, test "x$NEED_LIBAPM" = "xyes")
 AM_CONDITIONAL(BUILD_BATTSTAT_APPLET, test x$build_battstat_applet = xyes)
 
+dnl ******************************************
+dnl ** wireless check			    **
+dnl ******************************************
+
+HAVE_LIBIW=no
+AC_CHECK_LIB(iw,iw_print_version_info,[HAVE_LIBIW=yes],[HAVE_LIBIW=no])
+AC_SUBST(HAVE_LIBIW)
+AM_CONDITIONAL(HAVE_LIBIW, test "x$HAVE_LIBIW" = "xyes")
+
 dnl *******************************************
 dnl ** mixer applet check                    **
 dnl *******************************************
diff -uNr gnome-applets-2.6.1-orig/wireless/Makefile.am gnome-applets-2.6.1/wireless/Makefile.am
--- gnome-applets-2.6.1-orig/wireless/Makefile.am	2004-02-08 11:16:20.000000000 +0100
+++ gnome-applets-2.6.1/wireless/Makefile.am	2004-06-28 22:42:46.216797231 +0200
@@ -1,11 +1,22 @@
 ## Process this file with automake to produce Makefile.in
 
+if HAVE_LIBIW
+IWLIB = -liw
+IWDIR =
+IWINC = -DHAVE_LIBIW
+else
+IWLIB =
+IWDIR =
+IWINC =
+endif
+
 NULL=
 SUBDIRS = docs
 
 INCLUDES = 							\
 	-I$(top_srcdir)/intl 					\
 	-I$(top_srcdir)/screen-exec                             \
+	$(IWINC)						\
 	$(GNOME_APPLETS_CFLAGS)					\
 	$(LIBGLADE_CFLAGS)					\
 	-DICONDIR=\""$(datadir)/pixmaps"\"			\
@@ -24,6 +35,7 @@
 	$(top_builddir)/screen-exec/libscreen-exec.la   \
 	$(GNOME_APPLETS_LIBS) 	\
 	$(LIBGLADE_LIBS)	\
+	$(IWLIB)		\
 	$(NULL)
 
 gladedir = $(datadir)/wireless-applet/
diff -uNr gnome-applets-2.6.1-orig/wireless/wireless-applet.c gnome-applets-2.6.1/wireless/wireless-applet.c
--- gnome-applets-2.6.1-orig/wireless/wireless-applet.c	2004-04-13 12:39:46.000000000 +0200
+++ gnome-applets-2.6.1/wireless/wireless-applet.c	2004-06-28 22:42:46.217797008 +0200
@@ -29,6 +29,9 @@
 #include <errno.h>
 #include <math.h>
 #include <dirent.h>
+#ifdef HAVE_LIBIW
+#include <iwlib.h>
+#endif
 
 #include <gnome.h>
 #include <panel-applet.h>
@@ -63,6 +66,9 @@
 	PanelApplet base;
 	gchar *device;
 	gboolean show_percent;
+#ifdef HAVE_LIBIW
+	int max_link, avg_link;
+#endif
 
 	GList *devices;
 
@@ -188,6 +194,10 @@
 			     long int noise)
 {
 	int percent;
+#ifdef HAVE_LIBIW
+	int max_link = applet->max_link;
+	int avg_link = applet->avg_link;
+#endif
 
 	/* Calculate the percentage based on the link quality */
 	if (level < 0) {
@@ -196,7 +206,16 @@
 		if (link < 1) {
 			percent = 0;
 		} else {
+#ifdef HAVE_LIBIW
+			if (link > max_link)
+				percent = 100;
+			else if (link > avg_link)
+				percent = 50 + (link - avg_link)/(max_link - avg_link) * 50.0;
+			else 
+				percent = link/avg_link * 50.0;
+#else
 			percent = (int)rint ((log (link) / log (92)) * 100.0);
+#endif
 			percent = CLAMP (percent, 0, 100);
 		}
 	}
@@ -225,8 +244,30 @@
 	g_free (pixmapdir);
 }
 
+#ifdef HAVE_LIBIW
+static void
+wireless_applet_update_link_range (WirelessApplet *applet, gchar *device) {
+	struct iw_range range;
+	int skfd;
+
+	applet->max_link = 92;
+	applet->avg_link = 46;
+
+	if (!device) return;
+	if ((skfd = iw_sockets_open()) < 0) return;
+
+	iw_get_range_info (skfd, device, &range);
+	applet->max_link = range.max_qual.qual;
+	applet->avg_link = range.avg_qual.qual;
+	close (skfd);
+}
+#endif
+
 static void
 wireless_applet_set_device (WirelessApplet *applet, gchar *device) {
+#ifdef HAVE_LIBIW
+	wireless_applet_update_link_range (applet, device);
+#endif
 	g_free (applet->device);
 	applet->device = g_strdup (device);
 }
@@ -375,10 +416,16 @@
 {
 	applet->device = panel_applet_gconf_get_string (PANEL_APPLET (applet),
 			"device", NULL);
+#ifdef HAVE_LIBIW
+	wireless_applet_update_link_range (applet, applet->device);
+#endif
 
 	/* Oooh, new applet, let's put in the defaults */
 	if (applet->device == NULL)
 	{
+#ifdef HAVE_LIBIW
+		wireless_applet_update_link_range (applet, CFG_DEVICE);
+#endif
 		applet->device = g_strdup (CFG_DEVICE);
 		applet->show_percent = TRUE;
 		return;
