aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yakushev <yakushev.alex@gmail.com>2010-11-01 15:04:41 +0200
committerAlexander Yakushev <yakushev.alex@gmail.com>2010-11-01 15:04:41 +0200
commit832ea44554dd61e36e6112e34b294bf6caeec91c (patch)
treeb0ce212cac1ab46c68c6958aebf9fd8c3783dbb5
parent20b0165181a06aca65eaa3047cc219b036a09f54 (diff)
downloadawesompd-832ea44554dd61e36e6112e34b294bf6caeec91c.tar.gz
awesompd-832ea44554dd61e36e6112e34b294bf6caeec91c.tar.bz2
Widget buttons switched to awful.buttons
-rw-r--r--awesompd.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/awesompd.lua b/awesompd.lua
index f3721c0..786c666 100644
--- a/awesompd.lua
+++ b/awesompd.lua
@@ -73,14 +73,32 @@ function awesompd:run()
awful.hooks.timer.register(self.update_interval, function () self:update_track() end)
end
+-- Slightly modified function awful.util.table.join
+function awesompd.ajoin(buttons)
+ local result = {}
+ for i = 1, table.getn(buttons) do
+ if buttons[i] then
+ for k, v in pairs(buttons[i]) do
+ if type(k) == "number" then
+ table.insert(result, v)
+ else
+ result[k] = v
+ end
+ end
+ end
+ end
+ return result
+ end
+
-- Function that registers buttons on the widget.
function awesompd:register_buttons(buttons)
widget_buttons = {}
for b=1,table.getn(buttons) do
mods = self.split(buttons[b][1],"+")
- table.insert(widget_buttons, button(mods, buttons[b][2], buttons[b][3]))
+ table.insert(widget_buttons, awful.button(mods, buttons[b][2], buttons[b][3]))
end
- self.widget:buttons(widget_buttons)
+-- self.widget:buttons(widget_buttons)
+ self.widget:buttons(self.ajoin(widget_buttons))
end
-- /// Group of mpc command functions ///