]> git.madduck.net Git - etc/awesome.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

widget.bat: fixed ac variable; improved autodetection; #397
authorLuca CPZ <luca.cpz@gmail.com>
Tue, 31 Jul 2018 14:07:30 +0000 (16:07 +0200)
committerLuca CPZ <luca.cpz@gmail.com>
Tue, 31 Jul 2018 14:07:39 +0000 (16:07 +0200)
widget/bat.lua

index 03f9a0c8ef8aad935522fd85e7aae8e9c70baf73..2fece7d5bf48c7c918eeafca54ddc3a3598908c3 100644 (file)
@@ -41,7 +41,7 @@ local function factory(args)
             if bstr then
                 bat.batteries[#bat.batteries + 1] = bstr
             else
-                bat.ac = string.match(line, "AC%w+") or "AC0"
+                bat.ac = string.match(line, "A%w+") or "AC0"
             end
         end)
     end
@@ -141,7 +141,7 @@ local function factory(args)
                 bat_now.status = status
             end
         end
-        bat_now.ac_status = tonumber(helpers.first_line(string.format("%s%s/online", pspath, ac))) or "N/A"
+        bat_now.ac_status = tonumber(helpers.first_line(string.format("%s%s/online", pspath, bat.ac))) or "N/A"
 
         if bat_now.status ~= "N/A" then
             if bat_now.status ~= "Full" and sum_rate_power == 0 and bat_now.ac_status == 1 then