LoginSignup
4
3

More than 5 years have passed since last update.

[Emacs] バッテリ残量をちょっとおしゃれに表示

Last updated at Posted at 2015-01-26

unicode 文字で棒グラフ風。
"[○○%]" という表示はちょっと場所を取りすぎかなと思ったので。

(add-to-list 'mode-line-format
             '(:eval (let ((bat (read (cdr (assoc ?p (funcall battery-status-function))))))
                       (cond ((> bat 87)  "█") ((> bat 75)  "▇")
                             ((> bat 62)  "▆") ((> bat 50)  "▅")
                             ((> bat 37)  "▄") ((> bat 25)  "▃")
                             ((> bat 12)  "▂") (t           "▁")))))

screenshot : http://i.imgur.com/pRHm6FR.png

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3