stumpwm/stumpwm-contrib

cpu module broken by a commit

kamysheblid opened this issue · 1 comments

TLDR: How to Fix

The fix is to simply undo commit 910fa58

Cause

A commit 910fa58 from a year ago broke the cpu module for me as well as my modeline.

Specifically cpu.lisp (line 115)

(string-equal (alexandria:read-file-into-string (format nil "~A/type" x)) (format nil "x86_pkg_temp~%")))

This line is checking the /sys/class/thermal/thermal_zoneN/type (where N is a number) files to check if any of them contain the string "x86_pkg_temp". My type file does not contain that, it contains acpi instead. This causes my entire modeline to display Unable to expand mode line format string: #<TYPE-ERROR expected-type: REAL, and nothing else is displayed.

Simply undoing this commit fixes the cpu module and I dont get that error anymore.

Basically it causes *acpi-thermal-zone* var to be nil since it doesnt find any folder containing temperature information. This causes fmt-cpu-temp to let tempval be nil, then when it calls (bar-zone-color tempval *cpu-temp-med* *cpu-temp-hi* *cpu-temp-crit*) we get the following error:

The value
  NIL
is not of type
  REAL
when binding SB-KERNEL::N1
   [Condition of type TYPE-ERROR]

Because bar-zone-color was expecting a real number but got a null value.

I get the same error; is there a definitive solution?