stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] [PATCH] Add battery2.lisp - works with multiple batteries, u


From: John Li
Subject: Re: [STUMP] [PATCH] Add battery2.lisp - works with multiple batteries, uses sysfs.
Date: Mon, 21 Jul 2008 11:22:17 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jul 20, 2008 at 06:49:18PM +0100, Rupert Swarbrick wrote:
> 
> This looks nice! I hadn't used battery.lisp before, but I have spent
> most of the day getting this working on my machine. As Julian Stecklina
> seems to have found [1], sbcl hangs when reading from sysfs with the
> normal functions with some versions of the kernel (including mine!).
>
> So I coded up a non-blocking "read-line-noblock" function to use
> instead, based on a suggestion Alistair Bridgewater gives in that
> thread. No doubt it's slower than pukka CL:READ-LINE, but we're only
> reading a line from a couple of files each time, so meh.

Ah, I should have read the old threads more closely. Thanks for that.


> I also added a fall-back for the code to use energy_full and energy_now
> if charge_full and charge_now don't exist on the machine (since they
> don't here!).
[...]
> +    ;; My kernel uses energy_full + energy_now, so if charge_* didn't work, 
> try
> +    ;; that.
> +    (unless (and full charge)
> +      (setf full (bat-data bat "energy_full"))
> +      (setf charge (bat-data bat "energy_now")))

Hm, dammit. I was hoping sysfs would be more unified. I think it would
be cleaner to have *battery-rate*, *battery-full*, and *battery-level*
so users can set whatever exists on their machine.

Did you happen to try the module with your read-line replacement _and_
the original file names? I'm curious as to whether or not it crashed
(it shouldn't have).


Thanks a lot,
John




reply via email to

[Prev in Thread] Current Thread [Next in Thread]