summaryrefslogtreecommitdiff
path: root/lisp/battery.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-01-03 10:16:06 +0000
committerPo Lu <luangruo@yahoo.com>2022-01-03 10:18:08 +0000
commit4efaabaf272a557e68e7dd0e183afee3ef7ef4bc (patch)
tree5e94b23d8e9c658067acb367752c239d83f5a0f2 /lisp/battery.el
parentbd9a09bb6b9d636386b8336089e21f0ec15091cf (diff)
downloademacs-4efaabaf272a557e68e7dd0e183afee3ef7ef4bc.tar.gz
Implement AC line status for the Haiku battery function
* lisp/battery.el (battery--search-haiku-acpi-status): Return `fully-charged' instead of `normal'. (battery-haiku-acpi-battery): Implement %L for AC line status.
Diffstat (limited to 'lisp/battery.el')
-rw-r--r--lisp/battery.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/battery.el b/lisp/battery.el
index f4d59f30bbb..45334163fa6 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -651,7 +651,7 @@ Last Full Charge \\([[:digit:]]+\\)")
((not (zerop (logand state 2))) 'charging)
((not (zerop (logand state 1))) 'discharging)
((not (zerop (logand state 4))) 'critical)
- (t 'normal))
+ (t 'fully-charged))
:design-capacity design-capacity
:design-voltage design-voltage
:last-full-charge last-full-charge)))
@@ -663,6 +663,7 @@ This function only works on Haiku systems with an ACPI battery.
The following %-sequences are provided:
%c Current capacity (mAh)
%r Current rate of charge or discharge
+%L AC line status (verbose)
%B Battery status (verbose)
%b Battery status: empty means high, `-' means low,
`!' means critical, and `+' means charging
@@ -688,6 +689,8 @@ The following %-sequences are provided:
"-")
((eq state 'critical) "!")
(t ""))))
+ (cons ?L (if (not (eq (plist-get list :state) 'discharging))
+ "on-line" "off-line"))
(cons ?p (format "%.0f"
(* 100 (/ (plist-get list :capacity)
(plist-get list :last-full-charge))))))