stumpwm-devel
[Top][All Lists]
Advanced

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

Re: [STUMP] Modules (loading)


From: Lucas Pandolfo
Subject: Re: [STUMP] Modules (loading)
Date: Wed, 14 Jan 2015 09:31:57 -0300

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 <address@hidden> 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))))


reply via email to

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