For nanonote (debian)-emacs users
wolfgang at sharism.cc
Thu Jun 3 21:51:03 EDT 2010
wow, this is getting fun :-)
On Thu, Jun 03, 2010 at 08:33:40PM +0200, Rubén Berenguel wrote:
> Hi! If you add
> (defun read-lines (fpath)
> "Return a list of lines of a file at at FPATH. Taken from Xah Lee's website"
> (insert-file-contents fpath)
> (split-string (buffer-string) "\n" t)))
> (defun BatteryData ()
> (message (concat "Battery at " (car (read-lines
> "/sys/class/power_supply/battery/capacity")) "%%, "
> (car (read-lines "/sys/class/power_supply/battery/status")))))
> (global-set-key [f8] 'BatteryData)
> to your ~/.emacs file, when pressing f8 the message Battery at NN%,
> charging/discharging will appear in your message zone, under the mode
> line. Enjoy!
> * Rubén Berenguel
> * http://www.mostlymaths.net
> discussion mailing list
> discussion at lists.qi-hardware.com
More information about the discussion