mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-04 14:40:54 -08:00
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.
This commit is contained in:
parent
bd9a09bb6b
commit
4efaabaf27
1 changed files with 4 additions and 1 deletions
|
|
@ -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))))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue