Changes

Jump to: navigation, search

Battery

886 bytes added, 02:01, 5 April 2012
m
customization
{{Package
|name=Battery.el
|author = [[Ralph Schleicher]]
|description=Shows the battery status in the [[mode line]]
|source=http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/battery.el
|maintainer=[[FSF]]
|in_emacs=yes
|Development status=active
}}
 
== Basic setup ==
 
; {{Command|display-battery-mode}}
: Add your battery status to the [[Modeline]]
; {{Command|battery}}
: View battery status
 
== Customization ==
===Gnu/Linux ===
==== How to show battery status only on laptop? ====
if a device have no battery, we don't want to '''display-battery-mode''' be
enabled.<ref>http://stackoverflow.com/questions/5562974/emacs-is-it-running-on-laptop-or-on-desktop</ref>
 
<source lang="lisp">
(require 'battery)
(when (and battery-status-function
(not (string-match-p "N/A"
(battery-format "%B"
(funcall battery-status-function)))))
(display-battery-mode 1))
</source>
 
== See Also ==
[[time]]
[[Category:Desktop Management]]
[[Category:Appearance]]
437
edits

Navigation menu