From 63eb9d3548c7d4be1774b50cdc2169262dd43100 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 18 Apr 2023 23:45:34 +0800 Subject: [PATCH] Support Windows in battery segment. --- doom-modeline-segments.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index a9b62b1d..e6bff592 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -2707,7 +2707,9 @@ mouse-3: Switch to next unread buffer"))) (let* ((data (and battery-status-function (functionp battery-status-function) (funcall battery-status-function))) - (charging? (string-equal "AC" (cdr (assoc ?L data)))) + (status (cdr (assoc ?L data))) + (charging? (or (string-equal "AC" status) + (string-equal "on-line" status))) (percentage (car (read-from-string (or (cdr (assq ?p data)) "ERR")))) (valid-percentage? (and (numberp percentage) (>= percentage 0)