From 180a4473763d5181502b287c7ec492e5fb3a3244 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sun, 25 Dec 2005 14:09:57 +0000 Subject: [PATCH] (battery-linux-proc-acpi): Also try `/proc/acpi/thermal_zone/THM0/temperature'. --- lisp/ChangeLog | 5 +++++ lisp/battery.el | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b2e4f72403..91cc1de5b7f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-12-25 Romain Francoise + + * battery.el (battery-linux-proc-acpi): Also try + `/proc/acpi/thermal_zone/THM0/temperature'. + 2005-12-24 Chong Yidong * custom.el (custom-push-theme): Fix docstring. diff --git a/lisp/battery.el b/lisp/battery.el index 649cbe4c2c3..710be5a4220 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -347,6 +347,14 @@ The following %-sequences are provided: (when (re-search-forward "temperature: +\\([0-9]+\\) C$" nil t) (match-string 1)))) + (when (file-exists-p + "/proc/acpi/thermal_zone/THM0/temperature") + (with-temp-buffer + (insert-file-contents + "/proc/acpi/thermal_zone/THM0/temperature") + (when (re-search-forward + "temperature: +\\([0-9]+\\) C$" nil t) + (match-string 1)))) "N/A")) (cons ?r (or (and rate (concat (number-to-string rate) " " rate-type)) "N/A")) -- 2.39.5