Make battery checker check more standardized values

This commit is contained in:
eriedaberrie 2024-04-23 00:43:11 -07:00
parent 89abc90a68
commit db0995ea1f

View file

@ -979,15 +979,15 @@
(cd "~/")))
(defvar my-ac-previous-status t
"Whether battery was not in use on last check.")
"Whether connected to AC during last check.")
(require 'battery)
(defun my-bat-check ()
"Check if battery status has changed.
Used to toggle `goggles-pulse', `pixel-scroll-precision-mode', and `nyan-mode'."
(let ((ac-status (not (string=
(cdr (assq ?L (funcall battery-status-function)))
"BAT"))))
(cdr (assq ?B (funcall battery-status-function)))
"discharging"))))
(unless (eq ac-status my-ac-previous-status)
(setq my-ac-previous-status ac-status)
(when (boundp 'goggles-pulse)