Re: [STUMP] Modules (loading)

Lucas Pandolfo <[email protected]>
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <CALLZCYm8Pvy5ri9XwkmRaL8pad9wAXwDV1jA2XxPJgKNM7NJrA@mail.gmail.com>
Portability mostly :P

Well, it supports both */proc* and */sys* methods for linux (the default is
*sys*, but *proc* can be used changing **prefer-sysfs**).  Also supports
OpenBSD.

Other than that, the code is almost 3 times longer (well, no surprises
here) and the formatter is different.

On 14 January 2015 at 10:07, Kete Foy <[email protected]> wrote:

>  What's the difference between the battery and battery-portable modules?
>
> On 01/14/2015 07:31 AM, Lucas Pandolfo wrote:
>
>  Oh, i see.
>
>  I suppose you have the directory */sys/class/power_supply/BAT0*.
>  The battery module uses the */proc/acpi/battery/* path.
>
> Try replacing */proc/acpi/battery/* with  */sys/class/power_supply/ *in
> the *battery.lisp* file (line 28).
>
>
>
>
>
>  If this works the module can be refactored to export another variable
> **battery-path**. Something like:
>
> =====================================
>
> (export '(*battery-path*))
> (defvar *battery-path* nil)
>
> (defun read-battery-file (battery fname)
>   (let ((fields (make-hash-table :test #'equal)))
>     (with-open-file (s (or *battery-path* (concatenate 'string
> "/proc/acpi/battery/" battery "/" fname)
>                                  :if-does-not-exist nil)
>  ....)))
>
> =================================
>
>  And then users could do *(setf *battery-path*
> "/sys/class/power_supply/BAT0") *after loading the module.
>
> That or just make the module check for */proc/acpi/ *and then
> */sys/class/power_supply/* or wathever.
>
> On 14 January 2015 at 00:41, Kete Foy <[email protected]> wrote:
>
>>  On 01/10/2015 03:51 PM, Lucas Pandolfo wrote:
>>
>>  Is it a notebook?
>>
>>
>> Yes
>>
>>
>> If it is, what does  'ls /proc/acpi/battery/ -l' return?
>>
>>
>>  I don't have the battery directory in Parabola ("ArchLinux").
>>
>> By the way, here is the shell command that I use to monitor the battery
>> charge (requires the acpi package):
>> (setf stumpwm:*screen-mode-line-format*
>>       (list "%n |%w | %d | Battery"
>>       '(:eval (stumpwm:run-shell-command "acpi |cut -d ',' -f 2" t))))
>>
>
>
>

_______________________________________________
Stumpwm-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.