]> git.madduck.net Git - etc/awesome.git/blobdiff - widgets/alsabar.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:

uniform timers for single-instance widgets; #114
[etc/awesome.git] / widgets / alsabar.lua
index 1421975571993b8a173262e5a804c19c58b8f3d3..c957dbb997086fb40833254fd84ac091d4e725b3 100644 (file)
@@ -56,7 +56,7 @@ function alsabar.notify()
     local preset = {
         title   = "",
         text    = "",
-        timeout = 4,
+        timeout = 5,
         screen  = alsabar.notifications.screen,
         font    = alsabar.notifications.font .. " " ..
                   alsabar.notifications.font_size,
@@ -90,7 +90,7 @@ end
 
 local function worker(args)
     local args       = args or {}
-    local timeout    = args.timeout or 4
+    local timeout    = args.timeout or 5
     local settings   = args.settings or function() end
     local width      = args.width or 63
     local height     = args.heigth or 1
@@ -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, alsabar.update)
+
     return alsabar
 end