]> 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: move fallback ac to autodetection function
authorLuca CPZ <luca.cpz@gmail.com>
Thu, 26 Jul 2018 11:20:01 +0000 (13:20 +0200)
committerLuca CPZ <luca.cpz@gmail.com>
Thu, 26 Jul 2018 11:20:01 +0000 (13:20 +0200)
widget/bat.lua

index 8afd6a16598deb46b24d732932f55301c809cfbf..9d5b9ae4655f675d43dae8ddc20e36be2a34d784 100644 (file)
@@ -33,7 +33,7 @@ local function factory(args)
     end
 
     bat.batteries = args.batteries or (args.battery and {args.battery}) or {}
-    bat.ac        = args.ac or "AC0"
+    bat.ac        = args.ac
 
     function bat.get_batteries()
         helpers.line_callback("ls -1 " .. pspath, function(line)
@@ -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+") -- fallback one might be wrong
+                bat.ac = string.match(line, "AC%w+") or "AC0"
             end
         end)
     end