diff -rubE gkacpi2-0.4.orig/gkacpi.c gkacpi2-0.4/gkacpi.c
--- gkacpi2-0.4.orig/gkacpi.c	2002-09-15 16:53:39.000000000 +0800
+++ gkacpi2-0.4/gkacpi.c	2004-04-24 19:45:32.000000000 +0800
@@ -5,6 +5,9 @@
 
 #define	ACPI_CONFIG_KEYWORD	"acpi"
 
+#define PanelHeight		12
+#define ObjOffsetY		4
+
 #define PIC_NONE				0
 #define PIC_AC					1
 #define PIC_BATT				2
@@ -25,13 +28,13 @@
 static ACPIInfo acpi_info;
 struct acpi_table acpi_t;
 
-static gint panel_batt_on = TRUE, panel_proc_on = TRUE;
+static gint panel_batt_on = TRUE, panel_proc_on = TRUE, panel_thro_on = TRUE;
 static GkrellmMonitor *monitor;
-static GkrellmPanel *panel_batt, *panel_proc;
-static GkrellmKrell *krell_batt, *krell_proc;
+static GkrellmPanel *panel_batt, *panel_proc, *panel_thro;
+static GkrellmKrell *krell_batt, *krell_proc, *krell_thro;
 static GkrellmAlert	*acpi_alert_b;
 static GkrellmAlert	*acpi_alert_p;
-static GkrellmLauncher	launch_batt, launch_proc;
+static GkrellmLauncher	launch_batt, launch_proc, launch_thro;
 static GkrellmDecal  *decal_ac, *decal_batt, *decal_temp, *decal_term, *decal_throt;
 
 static gint style_id;
@@ -44,19 +47,21 @@
 */
 static GtkWidget	*enable_acpi_battery_button;
 static GtkWidget	*enable_acpi_temperature_button;
+static GtkWidget	*enable_acpi_throttling_button;
 static GtkWidget	*batt_launch_entry, *batt_tooltip_entry;
 static GtkWidget	*proc_launch_entry, *proc_tooltip_entry;
+static GtkWidget	*thro_launch_entry, *thro_tooltip_entry;
 static GtkWidget	*temperature_mode_button[3];
 static GtkWidget	*alert_button;
 
 static gchar			*acpi_info_text[] =
 {
-N_("Battery:\n"),
-N_("\tMiddle click to toggle between percent and remaining time.\n"),
-N_("\tWorks only while using battery.\n"),
-N_("\nTemperature:\n"),
-N_("\tMiddle click to toggle units.\n"),
-N_("\t")
+    N_("Battery:\n"),
+    N_("\tMiddle click to toggle between percent and remaining time.\n"),
+    N_("\tWorks only while using battery.\n"),
+    N_("\nTemperature:\n"),
+    N_("\tMiddle click to toggle units.\n"),
+    N_("\t")
 };
 
 //------------------------------------------------------------------------------
@@ -84,17 +89,23 @@
 }
 
 //------------------------------------------------------------------------------
+//
+static gint
+panel_thro_expose_event(GtkWidget *widget, GdkEventExpose *ev)
+{
+    gdk_draw_pixmap(widget->window,
+	    widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+	    panel_proc->pixmap, ev->area.x, ev->area.y, ev->area.x, ev->area.y,
+	    ev->area.width, ev->area.height);
+    return FALSE;
+}
 
-static void
-update_plugin()
+//------------------------------------------------------------------------------
+
+static void update_panel_batt(void)
 {
-  /* remaining time in minutes */
   gchar disp_txt[20];
     
-  /* no need to do it every second */
-  if (GK.two_second_tick) {
-	
-		if (panel_batt_on) {
 			get_battery_info(&acpi_info, &acpi_t);
 
 			switch (acpi_info.ac) {
@@ -138,34 +149,35 @@
 			}
 			
 			if (info_type == INFO_PERCENTAGE) {
-				snprintf(disp_txt, 20, " %i%%", (int) (acpi_info.batt_percent));
+	snprintf(disp_txt, sizeof(disp_txt)/sizeof(gchar), " %i%%", (int) (acpi_info.batt_percent));
 				gkrellm_draw_decal_text(panel_batt, decal_batt, disp_txt, -1);
 			}
 			else if (info_type == INFO_TIME) {
-				if (acpi_info.batt_minutes < 10)
-					snprintf(disp_txt, 20, " %2i:0%1i", acpi_info.batt_hours, acpi_info.batt_minutes);
-				else
-					snprintf(disp_txt, 20, " %2i:%2i", acpi_info.batt_hours, acpi_info.batt_minutes);
+	snprintf(disp_txt, sizeof(disp_txt)/sizeof(gchar), " %2i:%02i", acpi_info.batt_hours, acpi_info.batt_minutes);
 				gkrellm_draw_decal_text(panel_batt, decal_batt, disp_txt, -1);
 			}
 	
 			gkrellm_update_krell(panel_batt, krell_batt, acpi_info.batt_percent);
 
 			gkrellm_draw_panel_layers(panel_batt);
-		}
+}
+
+static void
+update_panel_proc(void)
+{
+    gchar disp_txt[20];
 			
-		if (panel_proc_on) {
 			get_processor_info(&acpi_info, &acpi_t);
 
 			switch (temperature_mode) {
 				case TEMP_UNITS_C:
-					snprintf(disp_txt, 20, " %iC", (int) (acpi_info.temperature));
+	    snprintf(disp_txt, sizeof(disp_txt)/sizeof(gchar), " %iC", (int) (acpi_info.temperature));
 					break;
 				case TEMP_UNITS_K:
-					snprintf(disp_txt, 20, " %iK", (int) (273 + acpi_info.temperature));
+	    snprintf(disp_txt, sizeof(disp_txt)/sizeof(gchar), " %iK", (int) (273 + acpi_info.temperature));
 					break;
 				case TEMP_UNITS_F:
-					snprintf(disp_txt, 20, " %iF", (int) (32 + 1.8 * acpi_info.temperature));
+	    snprintf(disp_txt, sizeof(disp_txt)/sizeof(gchar), " %iF", (int) (32 + 1.8 * acpi_info.temperature));
 					break;
 				default:
 					break;
@@ -174,12 +186,36 @@
 			gkrellm_check_alert(acpi_alert_p, acpi_info.temperature);
 			
 			gkrellm_draw_decal_text(panel_proc, decal_temp, disp_txt, -1);
-			gkrellm_draw_decal_text(panel_proc, decal_throt, acpi_info.throt_state, -1);
 			
 			gkrellm_update_krell(panel_proc, krell_proc, 100. * acpi_info.temperature / acpi_info.temperature_crit);
 	 
 			gkrellm_draw_panel_layers(panel_proc);
-		}
+}
+
+static void
+update_panel_thro(void)
+{
+    get_throttling_info(&acpi_info, &acpi_t);
+
+    gkrellm_draw_decal_text(panel_thro, decal_throt, acpi_info.throt_state, -1);
+
+    gkrellm_draw_panel_layers(panel_thro);
+}
+
+static void
+update_plugin()
+{
+    /* no need to do it every second */
+    if (GK.two_second_tick) {
+
+	if (panel_batt_on)
+	    update_panel_batt();
+
+	if (panel_proc_on)
+	    update_panel_proc();
+
+	if (panel_thro_on)
+	    update_panel_thro();
   }
 }
 
@@ -187,10 +223,8 @@
 
 static gint
 panel_batt_press(GtkWidget *widget, GdkEventButton *ev)	{
-	if (ev->button == 3)
-		gkrellm_open_config_window(monitor);
-	
-	else if (ev->button == 2) {
+    switch (ev->button) {
+	case 1:
 		switch (info_type) {
 			case INFO_PERCENTAGE:
 				info_type = INFO_TIME;
@@ -203,6 +237,10 @@
 			default:
 				break;
 		}
+	    break;
+	case 3:
+	    gkrellm_open_config_window(monitor);
+	    break;
 	}
 	return TRUE;
 }
@@ -210,11 +248,9 @@
 //------------------------------------------------------------------------------
 
 static gint
-panel_proc_press(GtkWidget *widget, GdkEventButton *ev)	{
-	if (ev->button == 3)
-		gkrellm_open_config_window(monitor);
-	
-	else if (ev->button == 2) {
+panel_proc_press(GtkWidget *widget, GdkEventButton *ev){
+    switch(ev->button){
+	case 1:
 		switch (temperature_mode) {
 			case TEMP_UNITS_C:
 				temperature_mode = TEMP_UNITS_K;
@@ -228,12 +264,23 @@
 			default:
 				break;
 		}
+	    break;
+	case 3:
+	    gkrellm_open_config_window(monitor);
+	    break;
 	}
 	return TRUE;
 }
 
 //------------------------------------------------------------------------------
 
+static gint
+panel_thro_press(GtkWidget *widget, GdkEventButton *ev){
+    return TRUE;
+}
+
+//------------------------------------------------------------------------------
+
 static void
 create_plugin(GtkWidget *vbox, gint first_create)
 {
@@ -246,6 +293,7 @@
 	if (first_create) {
 		panel_batt = gkrellm_panel_new0();
 		panel_proc = gkrellm_panel_new0();
+	panel_thro = gkrellm_panel_new0();
 	}
 
 	style = gkrellm_meter_style(style_id);
@@ -254,13 +302,15 @@
 	*/
 	
 	krell_image = gkrellm_krell_meter_piximage(style_id);
+
 	krell_batt = gkrellm_create_krell(panel_batt, krell_image, style);
 	gkrellm_monotonic_krell_values(krell_batt, FALSE);
-	gkrellm_set_krell_full_scale(krell_batt, 100, 1);
 
 	krell_proc = gkrellm_create_krell(panel_proc, krell_image, style);
 	gkrellm_monotonic_krell_values(krell_proc, FALSE);
-	gkrellm_set_krell_full_scale(krell_proc, 100, 1);
+
+    krell_thro = gkrellm_create_krell(panel_thro, krell_image, style);
+    gkrellm_monotonic_krell_values(krell_proc, FALSE);
 
 	/* temperature text
 	*/
@@ -268,38 +318,46 @@
 
 	pixmap = gdk_pixmap_create_from_xpm_d (vbox->window, &mask, NULL, (char **) battery_xpm);
 
-	decal_batt = gkrellm_create_decal_text(panel_batt, "XXXC", ts, style, (gkrellm_get_style_margins(style))->left, 12, -1);
+    decal_batt = gkrellm_create_decal_text(panel_batt, "XXXC", ts, style, (gkrellm_get_style_margins(style))->left, ObjOffsetY, -1);
 
-	decal_ac = gkrellm_create_decal_pixmap(panel_batt, pixmap, mask, 7, NULL, - 20, 12);
+    decal_ac = gkrellm_create_decal_pixmap(panel_batt, pixmap, mask, 7, NULL, - 20, ObjOffsetY);
 
-  decal_temp = gkrellm_create_decal_text(panel_proc, "XXXC", ts, style, (gkrellm_get_style_margins(style))->left, 12, -1);
-  decal_throt = gkrellm_create_decal_text(panel_proc, "--", ts, style, (gkrellm_get_style_margins(style))->left, 12, -1);
+    decal_temp = gkrellm_create_decal_text(panel_proc, "XXXC", ts, style, (gkrellm_get_style_margins(style))->left, ObjOffsetY, -1);
+    decal_throt = gkrellm_create_decal_text(panel_thro, "XXXC", ts, style, (gkrellm_get_style_margins(style))->left, ObjOffsetY, -1);
 
-	decal_term = gkrellm_create_decal_pixmap(panel_proc, pixmap, mask, 7, NULL, - 20, 12);
+    decal_term = gkrellm_create_decal_pixmap(panel_proc, pixmap, mask, 7, NULL, - 20, ObjOffsetY);
 
-/* Configure the panel to hold the above created decals, and create it.
+    /* Configure the panel to hold the above created decals, and create it.
 	*/
   gkrellm_panel_configure(panel_batt, NULL, style);
   gkrellm_panel_configure(panel_proc, NULL, style);
+    gkrellm_panel_configure(panel_thro, NULL, style);
+
+    gkrellm_panel_configure_set_height(panel_batt, PanelHeight);
+    gkrellm_panel_configure_set_height(panel_proc, PanelHeight);
+    gkrellm_panel_configure_set_height(panel_thro, PanelHeight);
 
 	/*  create panel
 	*/
   gkrellm_panel_create(vbox, monitor, panel_batt);
   gkrellm_panel_create(vbox, monitor, panel_proc);
+    gkrellm_panel_create(vbox, monitor, panel_thro);
+
+
+    gkrellm_move_decal(panel_batt, decal_ac, panel_batt->w - decal_ac->w - (gkrellm_get_style_margins(style))->right - 2, ObjOffsetY);
     
-	gkrellm_move_decal(panel_batt, decal_ac, panel_batt->w - decal_ac->w - (gkrellm_get_style_margins(style))->right - 2, 12);
+    gkrellm_move_decal(panel_proc, decal_term, panel_proc->w - decal_term->w - (gkrellm_get_style_margins(style))->right - 2, ObjOffsetY);
 
-	gkrellm_draw_decal_text(panel_proc, decal_throt, "--", 1);
-	gkrellm_move_decal(panel_proc, decal_throt, panel_proc->w - decal_term->w - decal_throt->w - (gkrellm_get_style_margins(style))->right - 6, 12);
-	gkrellm_move_decal(panel_proc, decal_term, panel_proc->w - decal_term->w - (gkrellm_get_style_margins(style))->right - 2, 12);
+    gkrellm_move_decal(panel_thro, decal_throt, panel_thro->w - decal_throt->w - (gkrellm_get_style_margins(style))->right - 2, ObjOffsetY);
 	  
 	gkrellm_draw_decal_text(panel_batt, decal_batt, "----", 1);
 	gkrellm_draw_decal_pixmap(panel_batt, decal_ac, PIC_AC);
 
 	gkrellm_draw_decal_text(panel_proc, decal_temp, "XXXC", 1);
-	gkrellm_draw_decal_text(panel_proc, decal_throt, "--", 1);
 	gkrellm_draw_decal_pixmap(panel_proc, decal_term, PIC_TERM);
 
+    gkrellm_draw_decal_text(panel_thro, decal_throt, "--", 1);
+
 	/* first create
 	*/
 	if (first_create) {
@@ -308,15 +366,21 @@
 
 		gtk_signal_connect(GTK_OBJECT (panel_proc->drawing_area), "expose_event", (GtkSignalFunc) panel_proc_expose_event, NULL);
 		gtk_signal_connect(GTK_OBJECT (panel_proc->drawing_area), "button_press_event", (GtkSignalFunc) panel_proc_press, NULL);
+
+	gtk_signal_connect(GTK_OBJECT (panel_thro->drawing_area), "expose_event", (GtkSignalFunc) panel_thro_expose_event, NULL);
+	gtk_signal_connect(GTK_OBJECT (panel_thro->drawing_area), "button_press_event", (GtkSignalFunc) panel_thro_press, NULL);
 	}
 
 	gkrellm_setup_launcher(panel_batt, &launch_batt, METER_PANEL_TYPE, 0);
 	gkrellm_setup_launcher(panel_proc, &launch_proc, METER_PANEL_TYPE, 0);
+    gkrellm_setup_launcher(panel_thro, &launch_thro, METER_PANEL_TYPE, 0);
 	
 	if (!panel_batt_on)
 		gkrellm_panel_hide(panel_batt);
 	if (!panel_proc_on)
 		gkrellm_panel_hide(panel_proc);
+    if (!panel_thro_on)
+	gkrellm_panel_hide(panel_thro);
 
 }
 
@@ -369,14 +433,14 @@
 
 static void
 acpi_set_alert_b(GtkWidget *entry, gpointer data)
-	{
+{
 	create_acpi_alert_b();
 	gkrellm_alert_config_window(&acpi_alert_b);
 }
 
 static void
 acpi_set_alert_p(GtkWidget *entry, gpointer data)
-	{
+{
 	create_acpi_alert_p();
 	gkrellm_alert_config_window(&acpi_alert_p);
 }
@@ -387,14 +451,16 @@
 save_acpi_config(FILE *f) {
 	fprintf(f, "%s enable_batt %d\n", ACPI_CONFIG_KEYWORD, panel_batt_on);
 	fprintf(f, "%s enable_proc %d\n", ACPI_CONFIG_KEYWORD, panel_proc_on);
+    fprintf(f, "%s enable_thro %d\n", ACPI_CONFIG_KEYWORD, panel_thro_on);
 	fprintf(f, "%s launch_batt %s\n", ACPI_CONFIG_KEYWORD, launch_batt.command);
 	fprintf(f, "%s batt_tooltip_comment %s\n",	ACPI_CONFIG_KEYWORD, launch_batt.tooltip_comment);
 	fprintf(f, "%s launch_proc %s\n", ACPI_CONFIG_KEYWORD, launch_proc.command);
 	fprintf(f, "%s proc_tooltip_comment %s\n",	ACPI_CONFIG_KEYWORD, launch_proc.tooltip_comment);
 	fprintf(f, "%s proc_mode %d\n",	ACPI_CONFIG_KEYWORD, temperature_mode);
+    fprintf(f, "%s launch_thro %s\n", ACPI_CONFIG_KEYWORD, launch_thro.command);
+    fprintf(f, "%s thro_tooltip_comment %s\n", ACPI_CONFIG_KEYWORD, launch_thro.tooltip_comment);
 	
 	gkrellm_save_alertconfig(f, acpi_alert_b, ACPI_CONFIG_KEYWORD, "batt");
-
 	gkrellm_save_alertconfig(f, acpi_alert_p, ACPI_CONFIG_KEYWORD, "proc");	
 }
 
@@ -410,6 +476,8 @@
 			sscanf(item, "%d", &panel_batt_on);
 		if (!strcmp(config, "enable_proc"))
 			sscanf(item, "%d", &panel_proc_on);
+	if (!strcmp(config, "enable_thro"))
+	    sscanf(item, "%d", &panel_thro_on);
 		if (!strcmp(config, "proc_mode"))
 			sscanf(item, "%d", &temperature_mode);
 		if (!strcmp(config, "launch_batt"))
@@ -420,6 +488,10 @@
 			launch_proc.command = g_strdup(item);
 		if (!strcmp(config, "proc_tooltip_comment"))
 			launch_proc.tooltip_comment = g_strdup(item);
+	if (!strcmp(config, "launch_thro"))
+	    launch_thro.command = g_strdup(item);
+	if (!strcmp(config, "thro_tooltip_comment"))
+	    launch_thro.tooltip_comment = g_strdup(item);
 		
 		if (!strcmp(config, GKRELLM_ALERTCONFIG_KEYWORD)) {
 			sscanf(item, "%s", s);
@@ -459,12 +531,21 @@
 	else
 		gkrellm_panel_hide(panel_proc);
 	
+    new = GTK_TOGGLE_BUTTON(enable_acpi_throttling_button)->active;
+    panel_thro_on = new;
+
+    if (panel_thro_on)
+	gkrellm_panel_show(panel_thro);
+    else
+	gkrellm_panel_hide(panel_thro);
+
 	for (i = 0; i < 3; ++i)
 		if (GTK_TOGGLE_BUTTON(temperature_mode_button[i])->active)
 			temperature_mode = i;
 
 	gkrellm_apply_launcher(&batt_launch_entry, &batt_tooltip_entry, panel_batt, &launch_batt, gkrellm_launch_button_cb);
 	gkrellm_apply_launcher(&proc_launch_entry, &proc_tooltip_entry, panel_proc, &launch_proc, gkrellm_launch_button_cb);
+    gkrellm_apply_launcher(&thro_launch_entry, &thro_tooltip_entry, panel_thro, &launch_thro, gkrellm_launch_button_cb);
 }
 	
 //------------------------------------------------------------------------------
@@ -479,7 +560,7 @@
 	gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tabs), GTK_POS_TOP);
 	gtk_box_pack_start(GTK_BOX(tab_vbox), tabs, TRUE, TRUE, 0);
 
-/* -- Battery tab */
+    /* -- Battery tab */
 	vbox = gkrellm_gtk_notebook_page(tabs, _("Battery"));
 
 	vbox1 = gkrellm_gtk_framed_vbox(vbox, _("Options"),	4, FALSE, 0, 2);
@@ -494,7 +575,7 @@
 	table = gkrellm_gtk_launcher_table_new(vbox1, 1);
 	gkrellm_gtk_config_launcher(table, 0, &batt_launch_entry, &batt_tooltip_entry, _("Battery"), &launch_batt);
 
-/* -- Temperature tab */
+    /* -- Temperature tab */
 	vbox = gkrellm_gtk_notebook_page(tabs, _("Temperature"));
 
 	vbox1 = gkrellm_gtk_framed_vbox(vbox, _("Options"),	4, FALSE, 0, 2);
@@ -534,24 +615,38 @@
 	table = gkrellm_gtk_launcher_table_new(vbox1, 1);
 	gkrellm_gtk_config_launcher(table, 0, &proc_launch_entry, &proc_tooltip_entry, _("Temperature"), &launch_proc);
 
-/* --About tab */
+    /* -- Throttling tab */
+    vbox = gkrellm_gtk_notebook_page(tabs, _("Throttling"));
+
+    vbox1 = gkrellm_gtk_framed_vbox(vbox, _("Options"),	4, FALSE, 0, 2);
+    hbox = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
+    gkrellm_gtk_check_button(hbox, &enable_acpi_throttling_button, panel_thro_on, FALSE, 10, _("Enable throttling"));
+    gtk_box_pack_start(GTK_BOX(hbox), enable_acpi_throttling_button, FALSE, FALSE, 0);
+    gtk_box_pack_end(GTK_BOX(hbox), alert_button, FALSE, FALSE, 0);		
+
+    vbox1 = gkrellm_gtk_framed_vbox_end(vbox, _("Launch Commands"),	4, FALSE, 0, 2);
+    table = gkrellm_gtk_launcher_table_new(vbox1, 1);
+    gkrellm_gtk_config_launcher(table, 0, &thro_launch_entry, &thro_tooltip_entry, _("Throttling"), &launch_thro);
+
+    /* --About tab */
 	vbox = gkrellm_gtk_notebook_page(tabs, _("Info"));
 	text = gkrellm_gtk_scrolled_text_view(vbox, NULL, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	
 	for (i = 0; i < sizeof(acpi_info_text)/sizeof(gchar *); ++i)
 		gkrellm_gtk_text_view_append(text, _(acpi_info_text[i]));
 
-/* --About tab */
+    /* --About tab */
 	vbox = gkrellm_gtk_notebook_page(tabs, _("About"));
 	label1 = gtk_label_new (_("GKACPI\nGKrellM ACPI plugin\n\ncopyright (c) 2002 Michal Suski\nsuseu@poczta.onet.pl\nhttp://gkacpi.sourceforge.net\n\nreleased under GNU Public License"));
   gtk_box_pack_start (GTK_BOX (vbox), label1, TRUE, TRUE, 0);
-	}
+}
 
 //------------------------------------------------------------------------------
 /* The monitor structure tells GKrellM how to call the plugin routines.
 */
 static GkrellmMonitor	plugin_mon	=
-	{
+{
 	"GKACPI",								// Name, for config tab
 	0,											// Id,  0 if a plugin
 	create_plugin,					// The create function
@@ -571,18 +666,18 @@
 
 	NULL,										// Handle if a plugin, filled in by GKrellM
 	NULL										// path if a plugin, filled in by GKrellM
-	};
+};
 
 //------------------------------------------------------------------------------
 /* All GKrellM plugins must have one global routine named init_plugin()
-which returns a pointer to a filled in monitor structure.
-*/
+   which returns a pointer to a filled in monitor structure.
+   */
 GkrellmMonitor *
 gkrellm_init_plugin()
 {
   /* before creating the plugin we initialise the ACPI check
   */
-  if (initialise_acpi(&acpi_info, &acpi_t)) {
+    if (initialize_acpi(&acpi_info, &acpi_t)) {
 		monitor = &plugin_mon;
 		return &plugin_mon;
 	}
diff -rubE gkacpi2-0.4.orig/libacpi.c gkacpi2-0.4/libacpi.c
--- gkacpi2-0.4.orig/libacpi.c	2002-08-25 20:43:47.000000000 +0800
+++ gkacpi2-0.4/libacpi.c	2004-04-24 19:47:47.000000000 +0800
@@ -17,15 +17,14 @@
 
 /* check if acpi is present and sane	
 */
-int
-initialise_acpi(ACPIInfo *a, struct acpi_table *a_t) {
+int initialize_acpi(ACPIInfo *a, struct acpi_table *a_t)
+{
   FILE *f;
   char s[128];
     
-  f = fopen("/proc/acpi/info", "r");
+    f = fopen(ACPI_PATH "/info", "r");
   if (!f) {
     fprintf(stderr, "This system does not support ACPI.\n");
-  
     return 0;
   }
   else {
@@ -42,11 +41,11 @@
     fclose(f);
   }
 	
-//  if (!set_files()) {
-//		fprintf(stderr, "This system supports old ACPI. Patch your kernel.\n");
+    //  if (!set_files()) {
+    //		fprintf(stderr, "This system supports old ACPI. Patch your kernel.\n");
 	  
-//		return 0;		
-//  }
+    //		return 0;		
+    //  }
   
   acpi_set_device_table(a_t);
   acpi_print_device_table(a_t);
@@ -59,8 +58,8 @@
 //------------------------------------------------------------------------------
 /* acpi find specific device
 */
-struct acpi_device *
-acpi_new_device			(char *d_d) {
+struct acpi_device *acpi_new_device(char *d_d)
+{
      struct acpi_device *tmp;
      
      tmp = malloc(sizeof(struct acpi_device));
@@ -77,8 +76,8 @@
 //------------------------------------------------------------------------------
 /* acpi find specific device
 */
-struct acpi_device * 
-acpi_find_device		(char *d_n) {
+struct acpi_device *acpi_find_device(char *d_n)
+{
     DIR *d;
     struct dirent *de;
     struct acpi_device *device = NULL;
@@ -123,9 +122,8 @@
 //------------------------------------------------------------------------------
 /* acpi device table
 */
-int
-acpi_set_device_table		(struct acpi_table *a_t) {
-
+int acpi_set_device_table(struct acpi_table *a_t)
+{
     a_t->dev_ac = acpi_find_device(AC_DEV_NAME);
     a_t->dev_batt = acpi_find_device(BATT_DEV_NAME);
     a_t->dev_butt = acpi_find_device(BUTT_DEV_NAME);
@@ -141,8 +139,8 @@
 //------------------------------------------------------------------------------
 /* acpi print device table
 */
-void
-acpi_print_device		(struct acpi_device *a_d) {
+void acpi_print_device(struct acpi_device *a_d)
+{
     struct acpi_device *dev;
     int i = 0;
     
@@ -158,9 +156,8 @@
 //------------------------------------------------------------------------------
 /* acpi print device table
 */
-void
-acpi_print_device_table		(struct acpi_table *a_t) {
-
+void acpi_print_device_table(struct acpi_table *a_t)
+{
     fprintf(stderr, "devices:\n");
     
     acpi_print_device(a_t->dev_ac);
@@ -176,65 +173,65 @@
 //------------------------------------------------------------------------------
 /* acpi file names
 */
-int 
-set_files() {
+int set_files()
+{
   FILE *f;
     
-  f = fopen("/proc/acpi/battery/BAT0/info", "r");
+    f = fopen(ACPI_PATH "/battery/BAT0/info", "r");
+
+    /* is it nessesery ? */
   if (!f) {
-	f = fopen("/proc/acpi/battery/BAT1/info", "r");
+	f = fopen(ACPI_PATH "/battery/BAT1/info", "r");
 	if (!f) {
 	  fprintf(stderr, "Can't find any battery.\n");
-			
 	  return 0;
 	}
 
-	sprintf(acpi_files.batt_info, "/proc/acpi/battery/BAT1/info");
-	sprintf(acpi_files.batt_state, "/proc/acpi/battery/BAT1/state");
+	sprintf(acpi_files.batt_info, ACPI_PATH "/battery/BAT1/info");
+	sprintf(acpi_files.batt_state, ACPI_PATH "/battery/BAT1/state");
   }
   else {
-	sprintf(acpi_files.batt_info, "/proc/acpi/battery/BAT0/info");
-	sprintf(acpi_files.batt_state, "/proc/acpi/battery/BAT0/state");
+	sprintf(acpi_files.batt_info, ACPI_PATH "/battery/BAT0/info");
+	sprintf(acpi_files.batt_state, ACPI_PATH "/battery/BAT0/state");
   }
 	
-  f = fopen("/proc/acpi/ac_adapter/AC/state", "r");
+    f = fopen(ACPI_PATH "/ac_adapter/AC/state", "r");
   if (!f) {
 	fprintf(stderr, "Can't find AC adapter.\n");
-			
 	return 0;
   }
   else {
-	sprintf(acpi_files.ac_state, "/proc/acpi/ac_adapter/AC/state");		
+	sprintf(acpi_files.ac_state, ACPI_PATH "/ac_adapter/AC/state");		
   }
 	
-  f = fopen("/proc/acpi/thermal_zone/THRM/temperature", "r");
+    f = fopen(ACPI_PATH "/thermal_zone/THM0/temperature", "r");
   if (!f) {
 	fprintf(stderr, "Can't find thermal zone.\n");
 			
 	return 0;
   }
   else {
-	sprintf(acpi_files.thrm_temp, "/proc/acpi/thermal_zone/THRM/temperature");		
+	sprintf(acpi_files.thrm_temp, ACPI_PATH "/thermal_zone/THM0/temperature");		
   }
 	
-  f = fopen("/proc/acpi/thermal_zone/THRM/trip_points", "r");
+    f = fopen(ACPI_PATH "/thermal_zone/THM0/trip_points", "r");
   if (!f) {
 	fprintf(stderr, "Can't find thermal zone.\n");
 			
 	return 0;
   }
   else {
-	sprintf(acpi_files.thrm_crit, "/proc/acpi/thermal_zone/THRM/trip_points");		
+	sprintf(acpi_files.thrm_crit, ACPI_PATH "/thermal_zone/THM0/trip_points");		
   }
 
-  f = fopen("/proc/acpi/processor/CPU0/throttling", "r");
+    f = fopen(ACPI_PATH "/processor/CPU/throttling", "r");
   if (!f) {
 	fprintf(stderr, "Can't find CPU throttling.\n");
 			
 	return 0;
   }
   else {
-	sprintf(acpi_files.cpu_throt, "/proc/acpi/processor/CPU0/throttling");		
+	sprintf(acpi_files.cpu_throt, ACPI_PATH "/processor/CPU/throttling");		
   }
 
   return 1;
@@ -244,8 +241,7 @@
 
 /* battery info
 */
-void
-get_battery_info(ACPIInfo *a, struct acpi_table *a_t)
+void get_battery_info(ACPIInfo *a, struct acpi_table *a_t)
 {
   FILE *f;
 	char f_name[128];
@@ -258,7 +254,7 @@
   int cur_cap = 0;
   int cur_percent = 0;
     
-	sprintf(f_name, "%s/%s/%s/state", ACPI_PATH, AC_DEV_NAME, a_t->dev_ac->device_name);
+    sprintf(f_name, ACPI_PATH "/%s/%s/state", AC_DEV_NAME, a_t->dev_ac->device_name);
   f = fopen(f_name, "r");
   if (f) {
     while (fgets(s, 128, f) != NULL) {
@@ -273,6 +269,7 @@
           a->ac = AC_ON;
         if (strcmp(s2, "off-line") == 0)
           a->ac = AC_OFF;
+		break;
       }
     }
     fclose(f);
@@ -283,7 +280,7 @@
     
   got_info = 0;
 	
-	sprintf(f_name, "%s/%s/%s/state", ACPI_PATH, BATT_DEV_NAME, a_t->dev_batt->device_name);
+    sprintf(f_name, ACPI_PATH "/%s/%s/state", BATT_DEV_NAME, a_t->dev_batt->device_name);
   f = fopen(f_name, "r");
   if (f) {
     while ((fgets(s, 128, f) != NULL) && (got_info != 3)) {
@@ -312,7 +309,7 @@
  			if (strcmp(s2, "rate:") == 0) {
         cur_rate = atoi(s3);
 				
-				if ((a->batt ==BATTERY_CHARGING) && (cur_rate == 0))
+		if ((a->batt == BATTERY_CHARGING) && (cur_rate == 0))
 					a->batt = BATTERY_OK;
 					
         got_info++;
@@ -330,7 +327,7 @@
   /* calculations
 	*/
 	cur_percent = ((float) cur_cap / (float) full_cap) * 100;
-	if (cur_percent > 100)
+    if (cur_percent > 100 || cur_percent < 0)
 			cur_percent = 100;
 	
 	if (cur_rate >0) {
@@ -350,19 +347,17 @@
 
 //------------------------------------------------------------------------------
 
-/* throttling info
-*/
-void
-get_processor_info(ACPIInfo *a, struct acpi_table *a_t)
+int get_thermal_info(ACPIInfo *a, struct acpi_table *a_t)
 {
   FILE *f;
   char s[128];
 	char f_name[128];
-  int got_info = 0;
 	
-	sprintf(f_name, "%s/%s/%s/temperature", ACPI_PATH, THRM_DEV_NAME, a_t->dev_thrm->device_name);
-  f = fopen(f_name, "r");
-  if (f) {
+    sprintf(f_name, ACPI_PATH "/%s/%s/temperature", THRM_DEV_NAME, a_t->dev_thrm->device_name);
+
+    if ((f = fopen(f_name, "r")) == NULL)
+	return -1;
+
     while (fgets(s, 128, f) != NULL) {
       char s1[25], s2[25], s3[25];
 
@@ -372,75 +367,126 @@
 
       if (strcmp(s1, "temperature:") == 0) {
         a->temperature = atoi(s2);
-        got_info++;
+	    break;
       }
 		}
 		fclose(f);
-  }
-	else {
-		printf("Failed to open %s\n", f_name);
-	}
 
-  got_info = 0;
+    return 0;
+}
+
+int __get_throttling_info(ACPIInfo *a, struct acpi_table *a_t)
+{
+    FILE *f;
+    char s[128];
+    char f_name[128];
+
+    sprintf(f_name, ACPI_PATH "/%s/%s/throttling", PROC_DEV_NAME, a_t->dev_proc->device_name);
+
+    if ((f = fopen(f_name, "r")) == NULL)
+	return -1;
 
-	sprintf(f_name, "%s/%s/%s/throttling", ACPI_PATH, PROC_DEV_NAME, a_t->dev_proc->device_name);
-  f = fopen(f_name, "r");
-  if (f) {
     while (fgets(s, 128, f) != NULL) {
-      char s1[25], s2[25], s3[25];
+	int n;
+	char s1[25], s2[25];
 
       /* read ac status
 			*/
-			sscanf(s, "%s %s %s", s1, s2, s3);
+	sscanf(s, "%s %*s %s", s1, s2, s2);
 
       if (strcmp(s1, "active") == 0) {
-				sprintf(a->throt_state, "%s", s3);
+	    sscanf(s2, "T%d", &n);
+	    sprintf(a->throt_state, "  %s: %2d%%", s2, (int)(12.5 * n));
+	    break;
       }
     }
     fclose(f);
-  }
-	else {
-		printf("Failed to open %s\n", f_name);
-	}
+
+    return 0;
+}
+
+/* throttling info
+*/
+void get_processor_info(ACPIInfo *a, struct acpi_table *a_t)
+{
+    if (get_thermal_info(a, a_t) < 0)
+	printf("Failed to get thermal info\n");
+}
+
+
+void get_throttling_info(ACPIInfo *a, struct acpi_table *a_t)
+{
+    if (__get_throttling_info(a, a_t) < 0)
+	printf("Failed to get throttling info\n");
 }
 
 //------------------------------------------------------------------------------
 
 /* battery pre-info
 */
-void
-get_design_cap(ACPIInfo *a, struct acpi_table *a_t)
+
+int
+get_battery_capacity(char *fname, struct acpi_table *a_t)
 {
+    char s[256];
   FILE *f;
-  char s[128];
-	char f_name[128];
-  int got_info = 0;
     
-	sprintf(f_name, "%s/%s/%s/info", ACPI_PATH, BATT_DEV_NAME, a_t->dev_batt->device_name);
-  f = fopen(f_name, "r");
-  if (f) {
-    while ((fgets(s, 128, f) != NULL) && got_info != 2) {
-      char s1[25], s2[25], s3[25], s4[25];
+    if ((f = fopen(fname, "r")) != NULL) {
+	while ((fgets(s, 128, f) != NULL)) {
+	    char s1[25], s2[25];
+
+	    sscanf(s, "%s %s", s1, s2);
+	    if (strcmp(s1, "present:") == 0) {
+		if (strcmp(s2, "no") == 0 && a_t->dev_batt->next != NULL) {
+		    struct acpi_device *tmp = a_t->dev_batt->next;
+		    a_t->dev_batt = tmp;
+		    return -1;
+		}
+		break;
+	    }
+	}
 
-      sscanf(s, "%s %s %s %s", s1, s2, s3, s4);
+	while (fgets(s, 128, f) != NULL) {
+	    char *str;
                 
-      if (strcmp(s1, "last") == 0) {
-        full_cap = atoi(s4);
-        got_info++;
+	    if ((str = strtok(s, ":")) == NULL)
+		continue;
+
+	    if (strcmp(str, "last full capacity") == 0) {
+		str = strtok(NULL, " ");
+		full_cap = atoi(str);
       }
 
-      if (strcmp(s3, "warning:") == 0) {
-        low_cap = atoi(s4);
-        got_info++;
+	    if (strcmp(str, "design capacity warning") == 0) {
+		str = strtok(NULL, " ");
+		low_cap = atoi(str);
       }
     }
+
     fclose(f);
   }
+    return 0;
+}
+
+void
+get_design_cap(ACPIInfo *a, struct acpi_table *a_t)
+{
+    FILE *f;
+    char s[128];
+    char f_name[128];
+
+try_to_get_battery_info:
+
+    if (a_t->dev_batt != NULL) {
+	sprintf(f_name, ACPI_PATH "/%s/%s/info", BATT_DEV_NAME, a_t->dev_batt->device_name);
+	if (get_battery_capacity(f_name, a_t) < 0)
+	    goto try_to_get_battery_info;
+    }
 	else {
-		printf("Failed to open %sn", f_name);
+	printf("Failed to open %s\n", f_name);
 	}
 
-	sprintf(f_name, "%s/%s/%s/trip_points", ACPI_PATH, THRM_DEV_NAME, a_t->dev_thrm->device_name);
+    sprintf(f_name, ACPI_PATH "/%s/%s/trip_points", THRM_DEV_NAME, a_t->dev_thrm->device_name);
   f = fopen(f_name, "r");
   if (f) {
     while (fgets(s, 128, f) != NULL) {
@@ -450,7 +496,7 @@
 
       if (strcmp(s1, "critical") == 0) {
         a->temperature_crit = atoi(s3);
-        got_info++;
+		break;
       }
 		}
 		fclose(f);
diff -rubE gkacpi2-0.4.orig/libacpi.h gkacpi2-0.4/libacpi.h
--- gkacpi2-0.4.orig/libacpi.h	2002-08-25 20:31:06.000000000 +0800
+++ gkacpi2-0.4/libacpi.h	2004-04-21 13:40:52.000000000 +0800
@@ -101,5 +101,6 @@
 
 void get_battery_info(ACPIInfo *, struct acpi_table *);
 void get_processor_info(ACPIInfo *, struct acpi_table *);
+void get_throttling_info(ACPIInfo *a, struct acpi_table *a_t);
 
 #endif
diff -rubE gkacpi2-0.4.orig/Makefile gkacpi2-0.4/Makefile
--- gkacpi2-0.4.orig/Makefile	2002-09-14 19:10:46.000000000 +0800
+++ gkacpi2-0.4/Makefile	2004-04-21 13:37:28.000000000 +0800
@@ -9,7 +9,7 @@
 IMLIB_LIB ?= `imlib-config --libs-gdk`
 PLUGIN_DIR ?= ~/.gkrellm2/plugins
 
-FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) $(IMLIB_INCLUDE)
+FLAGS = -O3 -Wall -fPIC $(GTK_INCLUDE) $(IMLIB_INCLUDE)
 LIBS = $(GTK_LIB) $(IMLIB_LIB)
 LFLAGS = -shared -lpthread
