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 "~/")))
|
(cd "~/")))
|
||||||
|
|
||||||
(defvar my-ac-previous-status t
|
(defvar my-ac-previous-status t
|
||||||
"Whether battery was not in use on last check.")
|
"Whether connected to AC during last check.")
|
||||||
|
|
||||||
(require 'battery)
|
(require 'battery)
|
||||||
(defun my-bat-check ()
|
(defun my-bat-check ()
|
||||||
"Check if battery status has changed.
|
"Check if battery status has changed.
|
||||||
Used to toggle `goggles-pulse', `pixel-scroll-precision-mode', and `nyan-mode'."
|
Used to toggle `goggles-pulse', `pixel-scroll-precision-mode', and `nyan-mode'."
|
||||||
(let ((ac-status (not (string=
|
(let ((ac-status (not (string=
|
||||||
(cdr (assq ?L (funcall battery-status-function)))
|
(cdr (assq ?B (funcall battery-status-function)))
|
||||||
"BAT"))))
|
"discharging"))))
|
||||||
(unless (eq ac-status my-ac-previous-status)
|
(unless (eq ac-status my-ac-previous-status)
|
||||||
(setq my-ac-previous-status ac-status)
|
(setq my-ac-previous-status ac-status)
|
||||||
(when (boundp 'goggles-pulse)
|
(when (boundp 'goggles-pulse)
|
||||||
|
|
Loading…
Reference in a new issue