From e031cce6bae9e42e5836c664afa5256e7a858f10 Mon Sep 17 00:00:00 2001 From: David Mak Date: Wed, 14 Feb 2024 00:59:08 +0800 Subject: [PATCH] collect: Fix reading of battery power draw on Linux This was erroneously set to read from the current battery charge. Fixes #770. --- src/linux/btop_collect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index d500192..1799b0d 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -835,7 +835,7 @@ namespace Cpu { if (b.use_power) { if (not b.power_now.empty()) { try { - watts = (float)stoll(readfile(b.energy_now, "-1")) / 1000000.0; + watts = (float)stoll(readfile(b.power_now, "-1")) / 1000000.0; } catch (const std::invalid_argument&) { } catch (const std::out_of_range&) { }