diff -pruN bfm-0.5.1/ChangeLog bfm-0.6.0/ChangeLog
--- bfm-0.5.1/ChangeLog	2001-11-27 13:55:34.000000000 +0000
+++ bfm-0.6.0/ChangeLog	2003-10-11 09:36:45.000000000 +0100
@@ -1,140 +1,14 @@
-This ChangeLog file is backwards.  Press "G" in vi to go to the end of it.
+2003-10-08 11:36  James Rowe  <Jay@jnrowe.uklinux.net>
 
-Sun, 7 Jan 2001 - 1.0
-    Initial FreeBSD port
-
-Fri, 12 Jan 2001 - 1.0pl1
-    Duck "upside down" mode
-    Initial version of "memory info" screen
-
-Mon, 15 Jan 2001 - 1.0pl2
-    FreeBSD memory code fixes
-
-Tue, 16 Jan 2001 - 1.0pl3
-    Most drawing operations rewritten and optimized
-    Modular changes - extra features under #ifdef
-    FreeBSD fixes
-
-Tue, 16 Jan 2001 - 1.0pl4
-    More fixes
-
-Thu, 18 Jan 2001 - 1.0pl6
-    Code reorganization
-    Command line options
-
-Thu, 18 Jan 2001 - 1.0pl7
-    All floating point calculations eliminated
-    FreeBSD changes
-    Added Xresource parsing for color, etc options
-    Load average/Memory screen toggle via shift key
-
-Sun, 21 Jan 2001 - 1.0pl8
-    Load average graph inside load average screen
-    system-dependent code updates
-    more features #ifdef'd
-
-Sun, 21 Jan 2001 - 1.0pl9
-    Load average / memory info screens, "picture lock".
-
-Sun, 21 Jan 2001 - 1.1test1
-    bubblemon_update() cleanup
-    bubblemon.h cleanup
-    load average graph updates
-    session_defaults() update
-    documentation updates
-
-Sun, 21 Jan 2001 - 1.1test2
-    argv count bug found and fixed
-    range checking for values read from Xdefaults
-    performance improvements in bubblemon_update()
-    FreeBSD memory code changes
-    documentation updates
-    removed last pieces of floating point numbers
-
-Mon, 22 Jan 2001 - 1.1test3
-    bubblemon_update() cleanup
-
-Thu, 25 Jan 2001 - 1.1test4
-    Code reorganization
-    Main Makefile will detect OS if GNU make is used
-    Moved system dependent code into sys_(uname).c
-    Changes to system-dependent code structure
-    Reorganization of include files and directory structure
-    History graphs for load average and memory use updates
-    Performance improvements
-    Some functions renamed
-    Off-by-one error in rgb image data fixed
-    BlackBox don't-draw-on-win feature
-    bubblemon_update() cleanup
-    Swapped load / memory screen order
-    FreeBSD memory code updates
-
-Sun, 28 Jan 2001 - 1.1test5
-    Load average logic change, update to Linux and FreeBSD dependent code
-    Other misc changes
-
-Mon, 29 Jan 2001 - 1.1test6
-    BubbleMonData is now a static structure
-    Performance improvements
-
-Wed, 31 Jan 2001 - 1.1test7
-    Documentation updates
-    Possible buffer overflow fix in session_defaults()
-
-Thu 01 Feb 2001 - 1.1
-    Minor documentation update
-    sys_freebsd math update
-    Version 1.1 released
-
-Wed 14 Feb 2001 - 1.2test1
-    SunOS port added
-
-Thu 15 Feb 2001 - 1.2
-    SunOS port fixed
-    Version 1.2 released
-
-Mon 19 Feb 2001 - 1.21test1
-    Various updates to the SunOS port
-    Added -k command line switch to display memory/swap in megabytes instead
-    of kilobytes.  Useful for machines with > 1024mb memory, since kilobytes
-    display stops at 999mb for both swap and physical ram
-    Portability fixes
-
-Thu 22 Feb 2001 - 1.21
-    Fix for FreeBSD CPU usage problem under high load
-    Released version 1.21
-
-Sun 25 Feb 2001 - 1.22
-    Fixed segfault which occured under certain low memory conditions, found
-    and fixed by "John H. Robinson, IV" <jaqque@ucsd.edu>
-    Released version 1.22
-
-Sat 10 Mar 2001 - 1.23
-    Patch from Dan Price to fix Shift Key detection on all platforms
-    Tracked down another segfault related to off-by-one-scanline error
-    Increased bm.bubblebuf allocation because bubbles created at the very
-    bottom of the "water" are drawn outside of 56x56 region.
-    Released version 1.23
-
-Fri 16 Mar 2001 - 1.3
-    Fixed load average graph - I don't know what the hell I was doing that
-    it worked before, but the way the code was written it was never supposed
-    to work :)
-    Added some contributed code to hopefully catch most of bubble-related
-    segfaults.  Thanks to "John H. Robinson, IV" <jaqque@ucsd.edu>
-    Updated Makefile to use proper libs when linking with gdk, etc.  Should
-    stop complaints about "missing library dependencies"
-    This is a recommented upgrade if you use bubblemon version 1.2 or newer.
-    Released version 1.3
-
-Sat 14 Apr 2001 - 1.31
-    FreeBSD machines were compiling bubblemon as "big-endian", resulting in
-    fairly weird looking color problem.  This has been fixed :)  Minor change
-    to Makefile.FreeBSD to put bubblemon in /usr/X11R6 during install.
-    Released version 1.31
-    
-Mon 16 Apr 2001 - 1.32
-    Important security update for FreeBSD - previous versions did not drop
-    kmem privileges, and programs started by clicking on the dockapp were
-    started with elevated privileges.  This is a required upgrade for FreeBSD
-    users.
+	* : Applied the gkrellm2 support patch from Debian's package, by
+		Sjoerd Simons <sjoerd@luon.net>.
+	* : Includes and installs the debian packages' manpage.
+	* : Hacked in Linux 2.6 mem support from the bubblemon-dockapp-1.41 
+		release.  Reads version from linux's version.h and builds
+		accordingly.
+	* : Hacked in OpenBSD compile time support from the 
+		bubblemon-dockapp-1.4 release.
+	* : Made GTK2 builds the default for both bubblefishymon and
+		gkrellm.
+	* : Bumped revision to 0.6.0 from the original 0.5.1 release on
+		http://pigeond.net/bfm/.
diff -pruN bfm-0.5.1/ChangeLog.orig bfm-0.6.0/ChangeLog.orig
--- bfm-0.5.1/ChangeLog.orig	1970-01-01 01:00:00.000000000 +0100
+++ bfm-0.6.0/ChangeLog.orig	2003-10-11 09:29:08.000000000 +0100
@@ -0,0 +1,140 @@
+This ChangeLog file is backwards.  Press "G" in vi to go to the end of it.
+
+Sun, 7 Jan 2001 - 1.0
+    Initial FreeBSD port
+
+Fri, 12 Jan 2001 - 1.0pl1
+    Duck "upside down" mode
+    Initial version of "memory info" screen
+
+Mon, 15 Jan 2001 - 1.0pl2
+    FreeBSD memory code fixes
+
+Tue, 16 Jan 2001 - 1.0pl3
+    Most drawing operations rewritten and optimized
+    Modular changes - extra features under #ifdef
+    FreeBSD fixes
+
+Tue, 16 Jan 2001 - 1.0pl4
+    More fixes
+
+Thu, 18 Jan 2001 - 1.0pl6
+    Code reorganization
+    Command line options
+
+Thu, 18 Jan 2001 - 1.0pl7
+    All floating point calculations eliminated
+    FreeBSD changes
+    Added Xresource parsing for color, etc options
+    Load average/Memory screen toggle via shift key
+
+Sun, 21 Jan 2001 - 1.0pl8
+    Load average graph inside load average screen
+    system-dependent code updates
+    more features #ifdef'd
+
+Sun, 21 Jan 2001 - 1.0pl9
+    Load average / memory info screens, "picture lock".
+
+Sun, 21 Jan 2001 - 1.1test1
+    bubblemon_update() cleanup
+    bubblemon.h cleanup
+    load average graph updates
+    session_defaults() update
+    documentation updates
+
+Sun, 21 Jan 2001 - 1.1test2
+    argv count bug found and fixed
+    range checking for values read from Xdefaults
+    performance improvements in bubblemon_update()
+    FreeBSD memory code changes
+    documentation updates
+    removed last pieces of floating point numbers
+
+Mon, 22 Jan 2001 - 1.1test3
+    bubblemon_update() cleanup
+
+Thu, 25 Jan 2001 - 1.1test4
+    Code reorganization
+    Main Makefile will detect OS if GNU make is used
+    Moved system dependent code into sys_(uname).c
+    Changes to system-dependent code structure
+    Reorganization of include files and directory structure
+    History graphs for load average and memory use updates
+    Performance improvements
+    Some functions renamed
+    Off-by-one error in rgb image data fixed
+    BlackBox don't-draw-on-win feature
+    bubblemon_update() cleanup
+    Swapped load / memory screen order
+    FreeBSD memory code updates
+
+Sun, 28 Jan 2001 - 1.1test5
+    Load average logic change, update to Linux and FreeBSD dependent code
+    Other misc changes
+
+Mon, 29 Jan 2001 - 1.1test6
+    BubbleMonData is now a static structure
+    Performance improvements
+
+Wed, 31 Jan 2001 - 1.1test7
+    Documentation updates
+    Possible buffer overflow fix in session_defaults()
+
+Thu 01 Feb 2001 - 1.1
+    Minor documentation update
+    sys_freebsd math update
+    Version 1.1 released
+
+Wed 14 Feb 2001 - 1.2test1
+    SunOS port added
+
+Thu 15 Feb 2001 - 1.2
+    SunOS port fixed
+    Version 1.2 released
+
+Mon 19 Feb 2001 - 1.21test1
+    Various updates to the SunOS port
+    Added -k command line switch to display memory/swap in megabytes instead
+    of kilobytes.  Useful for machines with > 1024mb memory, since kilobytes
+    display stops at 999mb for both swap and physical ram
+    Portability fixes
+
+Thu 22 Feb 2001 - 1.21
+    Fix for FreeBSD CPU usage problem under high load
+    Released version 1.21
+
+Sun 25 Feb 2001 - 1.22
+    Fixed segfault which occured under certain low memory conditions, found
+    and fixed by "John H. Robinson, IV" <jaqque@ucsd.edu>
+    Released version 1.22
+
+Sat 10 Mar 2001 - 1.23
+    Patch from Dan Price to fix Shift Key detection on all platforms
+    Tracked down another segfault related to off-by-one-scanline error
+    Increased bm.bubblebuf allocation because bubbles created at the very
+    bottom of the "water" are drawn outside of 56x56 region.
+    Released version 1.23
+
+Fri 16 Mar 2001 - 1.3
+    Fixed load average graph - I don't know what the hell I was doing that
+    it worked before, but the way the code was written it was never supposed
+    to work :)
+    Added some contributed code to hopefully catch most of bubble-related
+    segfaults.  Thanks to "John H. Robinson, IV" <jaqque@ucsd.edu>
+    Updated Makefile to use proper libs when linking with gdk, etc.  Should
+    stop complaints about "missing library dependencies"
+    This is a recommented upgrade if you use bubblemon version 1.2 or newer.
+    Released version 1.3
+
+Sat 14 Apr 2001 - 1.31
+    FreeBSD machines were compiling bubblemon as "big-endian", resulting in
+    fairly weird looking color problem.  This has been fixed :)  Minor change
+    to Makefile.FreeBSD to put bubblemon in /usr/X11R6 during install.
+    Released version 1.31
+    
+Mon 16 Apr 2001 - 1.32
+    Important security update for FreeBSD - previous versions did not drop
+    kmem privileges, and programs started by clicking on the dockapp were
+    started with elevated privileges.  This is a required upgrade for FreeBSD
+    users.
diff -pruN bfm-0.5.1/Makefile bfm-0.6.0/Makefile
--- bfm-0.5.1/Makefile	2001-11-27 21:52:28.000000000 +0000
+++ bfm-0.6.0/Makefile	2003-10-11 09:36:01.000000000 +0100
@@ -1,6 +1,8 @@
 # BubbleFishyMon with gkrellm support
-# Type 'make' to build bubblefishymon
-# Type 'make gkrellm' to build gkrellm-bfm.so
+# Type 'make' or 'make bubblefishymon' to build bubblefishymon
+# Type 'make bubblefishymon1' to build bubblefishymon for gtk1
+# Type 'make gkrellm' to build gkrellm-bfm.so for gkrellm2
+# Type 'make gkrellm1' to build gkrellm-bfm.so for gkrellm
 
 # bubblemon configuration
 EXTRA = -DENABLE_DUCK
@@ -9,6 +11,7 @@ EXTRA += -DENABLE_MEMSCREEN
 EXTRA += -DENABLE_FISH
 EXTRA += -DENABLE_TIME
 # EXTRA += -DUPSIDE_DOWN_DUCK
+# EXTRA += -DKDE_DOCKAPP
 
 # where to install this program
 PREFIX = /usr/local
@@ -16,14 +19,22 @@ PREFIX = /usr/local
 # no user serviceable parts below
 EXTRA += $(WMAN)
 
+# gtk cflags and gtk lib flags
+GTK_CFLAGS = $(shell gtk-config --cflags)
+GTK_LIBS = $(shell gtk-config --libs)
+
+GTK2_CFLAGS = $(shell pkg-config gtk+-2.0 --cflags)
+GTK2_LIBS = $(shell pkg-config gtk+-2.0 --libs)
+
 
 # optimization cflags
-CFLAGS = -O3 -Wall `gtk-config --cflags` ${EXTRA}
+#CFLAGS = -O3 -Wall ${EXTRA}
+CFLAGS = ${EXTRA}
 
 # profiling cflags
-# CFLAGS = -ansi -Wall -pg -O3 `gtk-config --cflags` ${EXTRA} -DPRO
+# CFLAGS = -ansi -Wall -pg -O3 ${EXTRA} -DPRO
 # test coverage cflags
-# CFLAGS = -fprofile-arcs -ftest-coverage -Wall -ansi -g `gtk-config --cflags` ${EXTRA} -DPRO
+# CFLAGS = -fprofile-arcs -ftest-coverage -Wall -ansi -g ${EXTRA} -DPRO
 
 
 SHELL = sh
@@ -42,24 +53,32 @@ STRIP = strip
 
 CC = gcc
 
+INSTALLMAN = -m 644
+
 
 
 # special things for Linux
 ifeq ($(OS), Linux)
 	SRCS += sys_linux.c
-    OBJS += sys_linux.o
-    LIBS = `gtk-config --libs | sed "s/-lgtk//g"`
-    INSTALL = -m 755
+	OBJS += sys_linux.o
+	INSTALL = -m 755
+	INSTALLMAN = -m 644
 endif
 
 # special things for FreeBSD
 ifeq ($(OS), FreeBSD)
 	SRCS += sys_freebsd.c
     OBJS += sys_freebsd.o
-    LIBS = `gtk-config --libs | sed "s/-lgtk//g"` -lkvm
+    LIBS = -lkvm
     INSTALL = -c -g kmem -m 2755 -o root
 endif
 
+# special things for OpenBSD
+ifeq ($(OS), OpenBSD)
+    OBJS += sys_openbsd.o
+    LIBS = `gtk-config --libs | sed "s/-lgtk//g"`
+endif
+
 #special things for SunOS
 ifeq ($(OS), SunOS)
 
@@ -78,22 +97,35 @@ ifeq ($(OS), SunOS)
     ifeq ($(COMPILER), gcc)
 	CFLAGS=-O3 -Wall
     endif
-    CFLAGS +=`gtk-config --cflags` ${EXTRA}
+    CFLAGS += ${EXTRA}
 	SRCS += sys_sunos.c
     OBJS += sys_sunos.o
-    LIBS = `gtk-config --libs` -lkstat -lm
+    LIBS = -lkstat -lm
     INSTALL = -m 755
 endif
 
 all: $(BUBBLEFISHYMON)
 
 gkrellm: clean_obj
-	$(CC) -DGKRELLM_BFM $(CFLAGS) -c $(SRCS) $(GKRELLM_SRCS)
-	$(CC) $(LDFLAGS) -o $(GKRELLM_BFM) $(OBJS) $(GKRELLM_OBJS)
+	$(CC) -DGKRELLM2 -DGKRELLM_BFM -fPIC $(GTK2_CFLAGS) $(CFLAGS) -c $(SRCS) \
+		$(GKRELLM_SRCS)
+	$(CC) $(GTK2_LIBS) $(LDFLAGS) -o $(GKRELLM_BFM) $(OBJS) $(GKRELLM_OBJS)
+	$(STRIP) $(GKRELLM_BFM)
+
+gkrellm1: clean_obj
+	$(CC) -DGKRELLM_BFM -fPIC $(GTK_CFLAGS) $(CFLAGS) -c $(SRCS) \
+		$(GKRELLM_SRCS)
+	$(CC) $(GTK_LIBS) $(LDFLAGS) -o $(GKRELLM_BFM) $(OBJS) $(GKRELLM_OBJS)
 	$(STRIP) $(GKRELLM_BFM)
 
-bubblefishymon: clean_obj $(OBJS)
-	$(CC) $(CFLAGS) -o $(BUBBLEFISHYMON) $(OBJS) $(LIBS)
+bubblefishymon: clean_obj
+	$(CC) $(GTK2_CFLAGS) $(CFLAGS) -o $(BUBBLEFISHYMON) \
+		$(LIBS) $(GTK2_LIBS) $(SRCS)
+	$(STRIP) $(BUBBLEFISHYMON)
+
+bubblefishymon1: clean_obj
+	$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $(BUBBLEFISHYMON) \
+		$(LIBS) $(GTK_LIBS) $(SRCS)
 	$(STRIP) $(BUBBLEFISHYMON)
 
 clean_obj:
@@ -103,5 +135,5 @@ clean:
 	rm -f bubblefishymon *.o *.bb* *.gcov gmon.* *.da *~ *.so
 
 install:
-	install $(INSTALL) $(BUBBLEFISHYMON) $(PREFIX)/bin
-
+	install $(INSTALL) $(BUBBLEFISHYMON) $(DESTDIR)$(PREFIX)/bin
+	install $(INSTALL_MAN) doc/bubblefishymon.1 $(DESTDIR)$(PREFIX)/man/man1
diff -pruN bfm-0.5.1/README bfm-0.6.0/README
--- bfm-0.5.1/README	2001-11-27 22:33:30.000000000 +0000
+++ bfm-0.6.0/README	2003-10-11 09:29:08.000000000 +0100
@@ -1,7 +1,9 @@
 
 BubbleFishyMon with gkrellm support
-Type 'make' to build bubblefishymon
-Type 'make gkrellm' to build gkrellm-bfm.so
+Type 'make' or 'make bubblefishymon' to build bubblefishymon
+Type 'make bubblefishymon1' to build bubblefishymon for gtk1
+Type 'make gkrellm' to build gkrellm-bfm.so for gkrellm2
+Type 'make gkrellm1' to build gkrellm-bfm.so for gkrellm
 
 
 TODO
diff -pruN bfm-0.5.1/bubblemon.c bfm-0.6.0/bubblemon.c
--- bfm-0.5.1/bubblemon.c	2001-12-01 14:19:26.000000000 +0000
+++ bfm-0.6.0/bubblemon.c	2003-10-11 09:29:08.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * bubblefishymon 0.4
+ * bubblefishymon 0.6.0
  *
  * Well, Hacks from bubblemon by timecop and Johan
  *
@@ -76,7 +76,7 @@
  */
 #define _GNU_SOURCE
 
-#define VERSION "1.32"
+#define VERSION "0.6.0"
 
 /* general includes */
 #include <stdio.h>
@@ -124,6 +124,7 @@ static void bubblemon_update(int proximi
 static void make_new_bubblemon_dockapp(void);
 static void get_memory_load_percentage(void);
 static void bubblemon_session_defaults(void);
+static int get_screen_selection(void);
 #if defined(ENABLE_CPU) || defined(ENABLE_MEMSCREEN)
 /* draw functions for load average / memory screens */
 static void draw_pixel(unsigned int x, unsigned int y, unsigned char *buf,
@@ -311,7 +312,7 @@ static void bubblemon_session_defaults(v
 /* *INDENT-OFF* */
 static void print_usage(void)
 {
-    printf( "BubbleMon version "VERSION", features: %s\n"
+    printf( "bubblefishymon version "VERSION", features: %s\n"
 	    "Usage: bubblefishymon [switches] [program_1] [program_2]\n\n"
 	    "Disable compiled-in features\n"
 #ifdef ENABLE_DUCK
@@ -353,6 +354,8 @@ int main(int argc, char **argv)
 #endif
 {
     char execute[256];
+    int proximity = 0;
+    int ch;
 #ifdef FPS
     int f, o;
     time_t y;
@@ -362,9 +365,7 @@ int main(int argc, char **argv)
 #endif
 
 #ifndef GKRELLM_BFM
-    int proximity = 0;
     GdkEvent *event;
-    int ch;
 #endif
 
 #ifdef FPS
@@ -677,19 +678,17 @@ static void make_new_bubblemon_dockapp(v
     GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
 
     GdkWindowAttr attr;
+    GdkWindowAttr attri;
+    Window win;
+    Window iconwin;
 
     XSizeHints sizehints;
 #ifndef GKRELLM_BFM
     XWMHints wmhints;
-    Window iconwin;
-    Window win;
-    GdkWindowAttr attri;
 #endif
 
     attr.width = 64;
     attr.height = 64;
-//    Pigeon
-//    attr.title = "bubblemon";
     attr.title = "bubblefishymon";
     attr.event_mask = MASK;
     attr.wclass = GDK_INPUT_OUTPUT;
@@ -719,7 +718,7 @@ static void make_new_bubblemon_dockapp(v
     attri.colormap = gdk_colormap_get_system();
     attri.wmclass_name = "bubblefishymon";
     attri.wmclass_class = "bubblefishymon";
-    attri.window_type = GDK_WINDOW_TOPLEVEL;
+    attri.window_type = GDK_WINDOW_CHILD;
 
     bm.iconwin = gdk_window_new(bm.win, &attri,
 				GDK_WA_TITLE | GDK_WA_WMCLASS);
@@ -751,6 +750,10 @@ static void make_new_bubblemon_dockapp(v
 
     gdk_window_show(bm.win);
 #endif
+#ifdef KDE_DOCKAPP
+    /* makes the dockapp visible inside KDE wm */
+    gdk_window_show(bm.iconwin);
+#endif
 
     /* We begin with zero bubbles */
     bm.n_bubbles = 0;
@@ -784,6 +787,7 @@ static void bubblemon_update(int proximi
     /* These values are for keeping track of where we have to start
        drawing water. */
     unsigned int waterlevel_min, waterlevel_max;
+    unsigned int real_waterlevel_min, real_waterlevel_max;
 
     /* These values are for keeping track how deep the duck is inside water */
     unsigned int action_min = 56;
diff -pruN bfm-0.5.1/doc/bubblefishymon.1 bfm-0.6.0/doc/bubblefishymon.1
--- bfm-0.5.1/doc/bubblefishymon.1	1970-01-01 01:00:00.000000000 +0100
+++ bfm-0.6.0/doc/bubblefishymon.1	2003-10-11 09:33:57.000000000 +0100
@@ -0,0 +1,69 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH BUBBLEFISHYMON 1 "September 6, 2002"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+bubblefishymon \- system load meter with ducks and fish
+.SH SYNOPSIS
+.B bubblefishymon
+.RI [ options ] " " [ program ] " " [ program ]
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B bubblefishymon
+command.
+This manual page was written for the Debian distribution
+because the original program does not have a manual page.
+.PP
+.B bubblefishymon
+is a dockapp-style system monitor for CPU, memory, swap, load average and network traffic.  Based on wmfishtime(1) and bubblemon, this program has been considerably improved over the parent code.
+.PP
+The higher the water level, the more memory is in use.  The more profuse the bubbles, the higher the CPU usage.  Fish represent network traffic direction and speed.
+.PP
+When the mouse is moved into the window, the display will change to chow the load history, or, if the right Shift key is held, the current memory usage.  If you press the right mouse button, the window will freeze in that state until you move the mouse out then back into the window.
+.PP
+.B program1
+and
+.B program2
+are the programs to spawn when either the left or middle mouse buttons are pressed, respectively.
+.SH OPTIONS
+.TP
+.B \-d
+disable swimming duck.
+.TP
+.B \-f
+disable fish.
+.TP
+.B \-c
+disable CPU meter.
+.TP
+.B \-m
+disable memory screen.
+.TP
+.B \-p
+use alternate colour scheme in memory info screen.
+.TP
+.B \-k
+display memory and swap statistics in megabytes.
+.TP
+.B \-h
+display help.
+.SH SEE ALSO
+.BR wmbubble(1)
+.BR bubblemon-gnome1(1)
+.SH AUTHOR
+This manual page was taken and adapted from wmbubble by Gurkan Sengun <gurkan@linuks.mine.nu>, and modified for the Debian system by Jamie Wilkinson <jaq@debian.org>.
+The original manual page for wmbubble was written by John H. Robinson, IV <jaqque@debian.org> for the for the Debian GNU/Linux system (but may be used by others).
diff -pruN bfm-0.5.1/gkrellm-bfm.c bfm-0.6.0/gkrellm-bfm.c
--- bfm-0.5.1/gkrellm-bfm.c	2001-12-01 14:34:09.000000000 +0000
+++ bfm-0.6.0/gkrellm-bfm.c	2003-10-11 09:29:08.000000000 +0100
@@ -23,18 +23,22 @@
  *
  */
 
+#ifdef GKRELLM2
+#include <gkrellm2/gkrellm.h>
+#else
 #include <gkrellm/gkrellm.h>
+#endif
 #include <libgen.h>
 #include <unistd.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <time.h>
 
-#define PLUGIN_VERSION	"0.5.1"
+#define PLUGIN_VERSION	"0.6.0"
 
 #define PLUGIN_NAME	"gkrellm-bfm"
 #define PLUGIN_DESC	"bubblefishymon gkrellm port"
-#define PLUGIN_URL	"http://pigeond.net/bfm/"
+#define PLUGIN_URL	"http://www.jnrowe.uklinux.net.net/projects/bfm/"
 #define PLUGIN_STYLE	PLUGIN_NAME
 #define PLUGIN_KEYWORD	PLUGIN_NAME
 
@@ -44,7 +48,18 @@
 #define CHART_W 56
 #define CHART_H 56
 
+#ifdef GKRELLM2
+# define Monitor     GkrellmMonitor
+# define Chart       GkrellmChart
+# define ChartConfig GkrellmChartconfig
+
+# define gkrellm_create_tab        gkrellm_gtk_notebook_page
+# define gkrellm_create_framed_tab gkrellm_gtk_framed_notebook_page
+# define gkrellm_scrolled_text     gkrellm_gtk_scrolled_text_view
+# define gkrellm_add_info_text     gkrellm_gtk_text_view_append_strings
 
+# define init_plugin gkrellm_init_plugin
+#endif
 
 static gint style_id;
 static char *prog = NULL;
@@ -261,6 +276,7 @@ create_plugin_tab(GtkWidget *tab_vbox)
 		"http://www.student.nada.kth.se/~d92-jwa/code/\n\n",
 		"More hacks by Timecop\n",
 		"http://www.ne.jp/asahi/linux/timecop/\n\n",
+		"And more hacks by James Rowe\n\n",
 		"<i>Usage\n\n",
 		"Nice monitor with:\n",
 		"- Water level representing the memory usage...\n",
diff -pruN bfm-0.5.1/sys_linux.c bfm-0.6.0/sys_linux.c
--- bfm-0.5.1/sys_linux.c	2001-11-26 23:13:40.000000000 +0000
+++ bfm-0.6.0/sys_linux.c	2003-10-11 09:29:08.000000000 +0100
@@ -18,9 +18,15 @@
  */
 
 #include <stdio.h>
+#include <string.h>
+#include <linux/version.h>
 #include "include/bubblemon.h"
 #include "include/sys_include.h"
 
+#if LINUX_VERSION_CODE > 0x20514
+#define  KERNEL_26
+#endif
+
 extern BubbleMonData bm;
 
 /* returns current CPU load in percent, 0 to 100 */
@@ -60,6 +66,8 @@ int system_cpu(void)
     if (ototal == 0)		/* ototal == 0 means that this is the first time
 				   we get here */
 	cpuload = 0;
+    else if ((total - ototal) <= 0)
+	cpuload = 100;
     else
 	cpuload = (100 * (load - oload)) / (total - ototal);
 
@@ -70,16 +78,57 @@ int system_memory(void)
 {
     u_int64_t my_mem_used, my_mem_max;
     u_int64_t my_swap_used, my_swap_max;
+#ifdef KERNEL_26
+    char *p;
+#endif
 
     static int mem_delay = 0;
     FILE *mem;
-    static u_int64_t aa, ab, ac, ad, ae, af, ag, ah;
+    static u_int64_t aa, ab, ac, ad;
+#ifndef KERNEL_26
+    static u_int64_t ae, af, ag, ah;
+#endif
     /* put this in permanent storage instead of stack */
     static char shit[2048];
 
     /* we might as well get both swap and memory at the same time.
      * sure beats opening the same file twice */
     if (mem_delay-- <= 0) {
+#ifdef KERNEL_26
+	mem = fopen("/proc/meminfo", "r");
+	memset(shit, 0, sizeof(shit));
+	fread(shit, 2048, 1, mem);
+	p = strstr(shit, "MemTotal");
+	if (p) {
+	    sscanf(p, "MemTotal:%Ld", &aa);
+	    my_mem_max = aa << 10;
+
+	    p = strstr(p, "Active");
+	    if (p) {
+		sscanf(p, "Active:%Ld", &ab);
+		my_mem_used = ab << 10;
+
+		p = strstr(p, "SwapTotal");
+		if (p) {
+		    sscanf(p, "SwapTotal:%Ld", &ac);
+		    my_swap_max = ac << 10;
+
+		    p = strstr(p, "SwapFree");
+		    if (p) {
+			sscanf(p, "SwapFree:%Ld", &ad);
+			my_swap_used = my_swap_max - (ad << 10);
+
+			bm.mem_used = my_mem_used;
+			bm.mem_max = my_mem_max;
+			bm.swap_used = my_swap_used;
+			bm.swap_max = my_swap_max;
+		    }
+		}
+	    }
+	}
+	fclose(mem);
+	mem_delay = 25;
+#else
 	mem = fopen("/proc/meminfo", "r");
 	fgets(shit, 2048, mem);
 	
@@ -106,6 +155,7 @@ int system_memory(void)
 	bm.mem_max = my_mem_max;
 	bm.swap_used = my_swap_used;
 	bm.swap_max = my_swap_max;
+#endif
 
 	/* memory info changed - update things */
 	return 1;
diff -pruN bfm-0.5.1/sys_openbsd.c bfm-0.6.0/sys_openbsd.c
--- bfm-0.5.1/sys_openbsd.c	1970-01-01 01:00:00.000000000 +0100
+++ bfm-0.6.0/sys_openbsd.c	2003-10-11 09:29:08.000000000 +0100
@@ -0,0 +1,130 @@
+/*  BubbleMon dockapp 1.2 - OpenBSD specific code
+ *  Copyright (C) 2001, Peter Stromberg <wilfried@openbsd.org>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/dkstat.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/resource.h>
+
+#include <uvm/uvm_object.h>
+#include <uvm/uvm_extern.h>
+#include <sys/swap.h>
+
+#include "include/bubblemon.h"
+#include "include/sys_include.h"
+
+extern BubbleMonData bm;
+
+/* Returns the current CPU load in percent */
+int system_cpu(void)
+{
+	int loadPercentage;
+	int previous_total, previous_load;
+	int total, load;
+	long cpu_time[CPUSTATES];
+	int i;
+
+	int mib[2];
+	size_t size;
+
+	mib[0] = CTL_KERN;
+	mib[1] = KERN_CPTIME;
+	size = sizeof (cpu_time);
+
+	if (sysctl(mib, 2, &cpu_time, &size, NULL, 0) < 0)
+	return 0;
+
+	load = cpu_time[CP_USER] + cpu_time[CP_SYS] + cpu_time[CP_NICE];
+	total = load + cpu_time[CP_IDLE];
+
+	i = bm.loadIndex;
+	previous_load = bm.load[i];
+	previous_total = bm.total[i];
+
+	bm.load[i] = load;
+	bm.total[i] = total;
+	bm.loadIndex = (i + 1) % bm.samples;
+
+	if (previous_total == 0)
+		loadPercentage = 0;	/* first time here */
+	else if (total == previous_total)
+		loadPercentage = 100;
+	else
+		loadPercentage = (100 * (load - previous_load)) / (total - previous_total);
+
+	return loadPercentage;
+}
+
+int system_memory(void)
+{
+#define pagetob(size) ((size) << (uvmexp.pageshift))
+	struct uvmexp uvmexp;
+	int nswap, rnswap, i;
+	int mib[] = { CTL_VM, VM_UVMEXP };
+	size_t size = sizeof (uvmexp);
+
+	if (sysctl(mib, 2, &uvmexp, &size, NULL, 0) < 0)
+		return 0;
+
+	bm.mem_used = pagetob(uvmexp.active);
+	bm.mem_max = pagetob(uvmexp.npages);
+	bm.swap_used = 0;
+	bm.swap_max = 0;
+	if ((nswap = swapctl(SWAP_NSWAP, 0, 0)) != 0) {
+		struct swapent *swdev = malloc(nswap * sizeof(*swdev));
+		if((rnswap = swapctl(SWAP_STATS, swdev, nswap)) != nswap) {
+			for (i = 0; i < nswap; i++) {
+				if (swdev[i].se_flags & SWF_ENABLE) {
+					bm.swap_used += (swdev[i].se_inuse / (1024 / DEV_BSIZE));
+					bm.swap_max += (swdev[i].se_nblks / (1024 / DEV_BSIZE));
+				}
+			}
+		}
+		free(swdev);
+	}
+
+	return 1;
+}
+
+#ifdef ENABLE_MEMSCREEN
+void system_loadavg(void)
+{
+	static int avg_delay;
+
+	if (avg_delay-- <= 0) {
+		struct loadavg loadinfo;
+		int i;
+		int mib[] = { CTL_VM, VM_LOADAVG };
+		size_t size = sizeof (loadinfo);
+
+		if (sysctl(mib, 2, &loadinfo, &size, NULL, 0) >= 0)
+			for (i = 0; i < 3; i++) {
+				bm.loadavg[i].i = loadinfo.ldavg[i] / loadinfo.fscale;
+				bm.loadavg[i].f = ((loadinfo.ldavg[i] * 100 + 
+				loadinfo.fscale / 2) / loadinfo.fscale) % 100;
+			}
+
+		avg_delay = ROLLVALUE;
+	}
+}
+#endif				/* ENABLE_MEMSCREEN */
+
+/* ex:set sw=4 ts=4: */
