summaryrefslogtreecommitdiff
path: root/battery-conf.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-06-05 00:58:57 +0800
committerJSDurand <mmemmew@gmail.com>2021-06-05 00:58:57 +0800
commitc4d526d25adf63c6a159096094e18b4c271b8e1c (patch)
treef2cb494c6c81fb4c57e47a0ebc08ae1fcb17b896 /battery-conf.el
parent88926c333ec078de572458b69f65dbfded85e39a (diff)
modeline: try to reduce the mode line clutter
* battery-conf.el (durand-battery-pmset): Whether it is AC or battery should be clear with one letter: A or B. * modeline.el (modeline-minor-modes-name-len-max): minor modes should be more important, as it is not easy to discover which of them are enabled. (modeline-buffer-name-len-max): And the name of the buffer is easily checked by a manual function call, so is less important to me.
Diffstat (limited to 'battery-conf.el')
-rw-r--r--battery-conf.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/battery-conf.el b/battery-conf.el
index 2781eda..271db2e 100644
--- a/battery-conf.el
+++ b/battery-conf.el
@@ -44,7 +44,8 @@ The following %-sequences are provided:
(ignore-errors (call-process "pmset" nil t nil "-g" "ps"))
(goto-char (point-min))
(when (re-search-forward "\\(?:Currentl?y\\|Now\\) drawing from '\\(AC\\|Battery\\) Power'" nil t)
- (setq power-source (match-string 1))
+ ;; One letter suffices
+ (setq power-source (substring (match-string 1) 0 1))
(when (re-search-forward "^ -InternalBattery-0\\([ \t]+(id=[0-9]+)\\)*[ \t]+" nil t)
(when (looking-at "\\([0-9]\\{1,3\\}\\)%")
(setq load-percentage (match-string 1))