Hello, since the default name of the CPU thermal zone, doesn't seem to work for many people, I implemented a little "heuristic": Look in /proc/acpi/thermal_zone and take the first file. This has the advantage that loading contrib/cpu.lisp will not crash stumpwm, when *acpi-thermal-zone* does not match reality. The worst thing that can happen, is that it reports some other temperature.
Patch attached or available on branch personal at http://cthulhu.c3d2.de/~blitz/git/stumpwm.git/ Regards, -- Julian Stecklina Well, take it from an old hand: the only reason it would be easier to program in C is that you can't easily express complex problems in C, so you don't. - Erik Naggum (in comp.lang.lisp) (Spam-Experiment: http://cthulhu.c3d2.de/~astro/badpit.html )
diff --git a/contrib/cpu.lisp b/contrib/cpu.lisp index d62a080..31ecdd3 100644 --- a/contrib/cpu.lisp +++ b/contrib/cpu.lisp @@ -120,8 +120,13 @@ utilization." :junk-allowed t))) (apply 'format nil "~F~A" (if (>= mhz 1000) (list (/ mhz 1000) "GHz") (list mhz "MHz"))))) -(defvar *acpi-thermal-zone* "THRM") - +(defvar *acpi-thermal-zone* (first (last + (pathname-directory + (first + (directory (make-pathname + :directory '(:absolute + "proc" "acpi" "thermal_zone" + :wild)))))))) (defun fmt-cpu-temp (ml) "Returns a string representing the current CPU temperature." (declare (ignore ml))
pgpQu3qb66TJT.pgp
Description: PGP signature
_______________________________________________ Stumpwm-devel mailing list Stumpwm-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/stumpwm-devel