For nanonote (debian)-emacs users

Wolfgang Spraul wolfgang at sharism.cc
Thu Jun 3 21:51:03 EDT 2010


wow, this is getting fun :-)
Very nice!
Wolfgang

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"
>   (with-temp-buffer
>     (insert-file-contents fpath)
>     (split-string (buffer-string) "\n" t)))
> 
> (defun BatteryData ()
>   (interactive)
>   (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!
> 
> Ruben
> 
> -- 
> ====================================
> * Rubén Berenguel
> * http://www.mostlymaths.net
> ====================================
> 
> _______________________________________________
> discussion mailing list
> discussion at lists.qi-hardware.com
> http://en.qi-hardware.com/mailman/listinfo/discussion




More information about the discussion mailing list


interactive