]> 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:

enhancement: unique timers for widgets; #114
authorLuke Bonham <dada@archlinux.info>
Thu, 9 Jul 2015 10:52:18 +0000 (12:52 +0200)
committercopycat-killer <dada@archlinux.info>
Wed, 5 Aug 2015 11:31:15 +0000 (13:31 +0200)
widgets/alsa.lua
widgets/alsabar.lua
widgets/bat.lua
widgets/contrib/tpbat/init.lua
widgets/fs.lua
widgets/weather.lua
wiki

index a3568923f35e7fd632a974d391ab2a92cf418859..979d9fd106470025942e650e99ac4e172d714fed 100644 (file)
@@ -60,7 +60,9 @@ local function worker(args)
         settings()
     end
 
-    newtimer("alsa", timeout, alsa.update)
+    timer_id = string.format("alsa-%s-%s", alsa.cmd, alsa.channel)
+
+    newtimer(timer_id, timeout, alsa.update)
 
     return setmetatable(alsa, { __index = alsa.widget })
 end
index 1421975571993b8a173262e5a804c19c58b8f3d3..2639aa4af94f9268504f47c4f36dc303cf9affe7 100644 (file)
@@ -148,8 +148,6 @@ local function worker(args)
         settings()
     end
 
-    newtimer("alsabar", timeout, alsabar.update)
-
     alsabar.bar:buttons (awful.util.table.join (
           awful.button ({}, 1, function()
             awful.util.spawn(alsabar.mixer)
@@ -168,6 +166,10 @@ local function worker(args)
           end)
     ))
 
+    timer_id = string.format("alsabar-%s-%s", alsabar.cmd, alsabar.channel)
+
+    newtimer(timer_id, timeout, alsa.update)
+
     return alsabar
 end
 
index 572d099266ad2683bf6890f7e3682ef9546523ff..626239b14c28d2b32b6f1a9fc29d739e9cff5543 100644 (file)
@@ -141,7 +141,7 @@ local function worker(args)
         end
     end
 
-    newtimer("bat", timeout, update)
+    newtimer(battery, timeout, update)
 
     return bat.widget
 end
index 782bf353deafc00c5d0c39f0edb5cc17c162b6a1..0a22526fedffb3e6937d86218861ff2d088bbfa1 100644 (file)
@@ -159,7 +159,7 @@ function tpbat.register(args)
         settings()
     end
 
-    newtimer("tpbat", timeout, update)
+    newtimer("tpbat-" .. bat.name, timeout, update)
 
     widget:connect_signal('mouse::enter', function () tpbat:show() end)
     widget:connect_signal('mouse::leave', function () tpbat:hide() end)
index 8b51178d193aa6f38c2b05023e1d53ceeb22c387..fab61bd5a53ed9392d9c0f4a0599a1d70f1ed350 100644 (file)
@@ -61,7 +61,7 @@ local function worker(args)
 
     fs.widget = wibox.widget.textbox('')
 
-    helpers.set_map("fs", false)
+    helpers.set_map(partition, false)
 
     function update()
         fs_info = {}
@@ -91,7 +91,7 @@ local function worker(args)
         widget = fs.widget
         settings()
 
-        if fs_now.used >= 99 and not helpers.get_map("fs")
+        if fs_now.used >= 99 and not helpers.get_map(partition)
         then
             naughty.notify({
                 title = "warning",
@@ -100,17 +100,17 @@ local function worker(args)
                 fg = "#000000",
                 bg = "#FFFFFF",
             })
-            helpers.set_map("fs", true)
+            helpers.set_map(partition, true)
         else
-            helpers.set_map("fs", false)
+            helpers.set_map(partition, false)
         end
     end
 
-    helpers.newtimer(partition, timeout, update)
-
     widget:connect_signal('mouse::enter', function () fs:show(0) end)
     widget:connect_signal('mouse::leave', function () fs:hide() end)
 
+    helpers.newtimer(partition, timeout, update)
+
     return setmetatable(fs, { __index = fs.widget })
 end
 
index d1624fa4d4704ffa648c697d63b090dd8d642b32..77d9b9be88268d25f599090123cac0f3c762dcc0 100644 (file)
@@ -121,8 +121,8 @@ local function worker(args)
 
     weather.attach(weather.widget)
 
-    newtimer("weather", timeout, weather.update)
-    newtimer("weather_forecast", timeout, weather.forecast_update)
+    newtimer("weather-" .. city_id, timeout, weather.update)
+    newtimer("weather_forecast" .. city_id, timeout, weather.forecast_update)
 
     return setmetatable(weather, { __index = weather.widget })
 end
diff --git a/wiki b/wiki
index b260e938c83f1339b0b4b3b003f33f302f9a47b1..54b3a717b2f7069264ce5a20018ae4abf153e7b2 160000 (submodule)
--- a/wiki
+++ b/wiki
@@ -1 +1 @@
-Subproject commit b260e938c83f1339b0b4b3b003f33f302f9a47b1
+Subproject commit 54b3a717b2f7069264ce5a20018ae4abf153e7b2