]> git.madduck.net Git - etc/awesome.git/blobdiff - .config/awesome/rc.lua

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:

reformat battery indicator
[etc/awesome.git] / .config / awesome / rc.lua
index 64740b2bd9cec36b8763565fc1d291a97be33940..c7cd4055cab163d20bbeee815348955ea56fde18 100644 (file)
@@ -300,6 +300,9 @@ clientkeys =
     key({ modkey }, "t", awful.client.togglemarked),
     key({ modkey,}, "m",
         function (c)
     key({ modkey }, "t", awful.client.togglemarked),
     key({ modkey,}, "m",
         function (c)
+            if not awful.client.floating then
+                awful.client.floating.toggle()
+            end
             c.maximized_horizontal = not c.maximized_horizontal
             c.maximized_vertical   = not c.maximized_vertical
         end),
             c.maximized_horizontal = not c.maximized_horizontal
             c.maximized_vertical   = not c.maximized_vertical
         end),
@@ -485,7 +488,8 @@ awful.hooks.manage.register(function (c, startup)
 
     -- Maximise some
     if maxapps[inst] or maxapps[cls] then
 
     -- Maximise some
     if maxapps[inst] or maxapps[cls] then
-      awful.client.maximize(c)
+        c.maximized_horizontal = not c.maximized_horizontal
+        c.maximized_vertical   = not c.maximized_vertical
     end
 end)
 
     end
 end)
 
@@ -555,7 +559,7 @@ function get_acpibatt()
     -- Battery 0: Full, 100%
     -- so find the first bit first and then go look for the time
     local st, en, status, percent = string.find(s, '%a+%s%d:%s(%a+),%s(%d+%%)');
     -- Battery 0: Full, 100%
     -- so find the first bit first and then go look for the time
     local st, en, status, percent = string.find(s, '%a+%s%d:%s(%a+),%s(%d+%%)');
-    local st, en, time = string.find(s, ',%s(%d+:%d+:%d+)%s%a+', en);
+    local st, en, time = string.find(s, ',%s(%d+:%d+):%d+%s%a+', en);
 
     if not status or not percent then -- time can be empty if we're full
       return "couldn't parse line " .. s
 
     if not status or not percent then -- time can be empty if we're full
       return "couldn't parse line " .. s
@@ -566,14 +570,15 @@ function get_acpibatt()
     end
 
     if status == 'Charging' then
     end
 
     if status == 'Charging' then
-      status = 'c';
-    elseif status == 'Discarching' then
-      status = 'd';
-    else
+      status = '+';
+    elseif status == 'Discharging' then
       status = '-';
       status = '-';
+    else
+      status = 'x';
     end
 
     end
 
-    return percent; -- .. ' (' .. status .. ')'; -- .. ' ' .. time .. ' left';
+    return status .. ' ' .. time;
+    -- return percent .. ' (' .. status .. ')'; -- .. ' ' .. time .. ' left';
 end
 -- }}}
 
 end
 -- }}}