Re: [STUMP] Modules (loading)
Lucas Pandolfo <[email protected]>
| Newsgroups | gmane.comp.window-managers.stumpwm.devel |
|---|---|
| Message-ID | <CALLZCY=KxrQtaPg2MpU-bnCgEd5BX0u5JMaEFD1af4K+FAC_dw@mail.gmail.com> |
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