Skip to content

Commit

Permalink
Support Windows in battery segment.
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Apr 18, 2023
1 parent ed72a56 commit 63eb9d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doom-modeline-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 63eb9d3

Please sign in to comment.