Make battery checker check more standardized values
This commit is contained in:
parent
89abc90a68
commit
db0995ea1f
6
init.el
6
init.el
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue