diff -c cpuspeed-1.2.1/cpuspeed.cc cpuspeed-1.2.1-bcl/cpuspeed.cc
*** cpuspeed-1.2.1/cpuspeed.cc	2005-01-09 15:03:35.000000000 -0800
--- cpuspeed-1.2.1-bcl/cpuspeed.cc	2006-07-08 07:10:12.000000000 -0700
***************
*** 15,20 ****
--- 15,21 ----
  
      Contributors:
          Enrico Tassi <tassi@cs.unibo.it>
+ 	Brian C. Lane <bcl@brianlane.com>
  
      This program is only for computers with Linux kernels compiled with
      CPUFreq.  You must have a CPU that supports frequency and/or voltage
***************
*** 365,370 ****
--- 366,376 ----
  unsigned max_temperature;
  
  // if this is set (via command line) throttle down CPU to minimum if
+ // the string is found in the first line of the file
+ const char * test_filename = 0;
+ const char * test_string = 0;
+ 
+ // if this is set (via command line) throttle down CPU to minimum if
  // AC power is disconnected
  const char * ac_filename = 0;
  
***************
*** 429,434 ****
--- 435,452 ----
              if (strtol(p, 0, 10) > (long)max_temperature)
                  state = SPEED_MIN;
          }
+ 
+         // check the 'test' file for a string
+         if (test_filename && test_string && state != SPEED_MIN)
+         {
+             read_line(test_filename, line, sizeof line);
+             p = strstr(line, test_string);
+ #ifdef DEBUG_BCL
+             fprintf(stderr, "test line: %s\n", line);
+ #endif
+             if(p)
+                 state = SPEED_MIN;
+         }
      }
  
      // figure out what our current speed should be
***************
*** 681,686 ****
--- 699,711 ----
              fprintf(stderr, "%u fake CPU(s) detected\n", num_cpus);
          }
  #endif
+         else if (!strcmp(argv[i], "-F"))
+         {
+             if (argc <= i + 2)
+                 die(false, "The \'-F\' option must be followed by a filename and a string");
+             test_filename = argv[++i];
+ 	    test_string = argv[++i];
+         }
          else
          {
              fprintf(
***************
*** 757,762 ****
--- 782,791 ----
                  "            of CPUs in the system.  Without this option the program creates\n"
                  "            copies of itself to manage every CPU in the system.\n"
                  "\n"
+ 		"        -F <file> <string>\n"
+ 		"            Test the first line of a file for a string. If true then set the\n"
+ 		"            CPU to its minimum speed.\n"
+ 		"\n"
                  "    To have a CPU stay at the highest clock speed to maximize performance send\n"
                  "    the process controlling that CPU the SIGUSR1 signal.\n"
                   "\n"
***************
*** 767,773 ****
                  "    controlling that CPU the SIGHUP signal.\n"
                   "\n"
                  "Author:\n"
!                 "    Carl Thompson - cet [at] carlthompson.net  (copyright 2002 - 2005)\n"
                  "\n"
                  , NAME, VERSION, NAME, NAME
              );
--- 796,802 ----
                  "    controlling that CPU the SIGHUP signal.\n"
                   "\n"
                  "Author:\n"
!                 "    Carl Thompson - cet [at] carlthompson.net  (copyright 2002 - 2006)\n"
                  "\n"
                  , NAME, VERSION, NAME, NAME
              );
diff -c cpuspeed-1.2.1/cpuspeed.conf cpuspeed-1.2.1-bcl/cpuspeed.conf
*** cpuspeed-1.2.1/cpuspeed.conf	2005-01-09 15:11:28.000000000 -0800
--- cpuspeed-1.2.1-bcl/cpuspeed.conf	2006-07-08 07:13:11.000000000 -0700
***************
*** 12,14 ****
--- 12,18 ----
  
  # uncomment and modify this to check the system temperature
  #OPTS="$OPTS -t /proc/acpi/thermal_zone/*/temperature 75"
+ 
+ # Watch for a lid close event, turn CPU down to minimum
+ #OPTS="$OPTS -F /proc/acpi/button/lid/LID/state close"
+ 
