Fix mail widget update and revert some widget layout changes

This commit is contained in:
crater2150 2015-06-14 00:00:56 +02:00
parent 0bbf605eac
commit c1aafbb266
2 changed files with 6 additions and 7 deletions

3
rc.lua
View file

@ -32,8 +32,7 @@ for s = 1, screen.count() do
local lbottom = widgets.layout(s, "left", "bottom") local lbottom = widgets.layout(s, "left", "bottom")
local rbottom = widgets.layout(s, "right", "bottom") local rbottom = widgets.layout(s, "right", "bottom")
local clock = widgets.add.clock("clock", rtop) local clock = widgets.add.clock("clock", ltop)
clock:set_right(10)
widgets.add.layout_indicator(lbottom) widgets.add.layout_indicator(lbottom)
widgets.add.taglist("tags", lbottom) widgets.add.taglist("tags", lbottom)

View file

@ -132,13 +132,13 @@ local hide = function(self)
self:set_widget(nil) self:set_widget(nil)
end end
local function wrap_and_add(name, parent, widget) local function wrap_and_add(name, parent, widget, callback_widget)
local container = wibox.layout.margin(widget) local container = wibox.layout.margin(widget)
container.widget = widget container.widget = widget
container.show = show container.show = show
container.hide = hide container.hide = hide
wlist[parent.screen][name] = widget wlist[parent.screen][name] = callback_widget == nil and widget or callback_widget
parent.layout:add(container) parent.layout:add(container)
return container return container
end end
@ -150,12 +150,12 @@ local function mailwidget(name, parent, mailboxes, notify_pos, title) --{{{
local bg = wibox.widget.background() local bg = wibox.widget.background()
bg:set_widget(widget) bg:set_widget(widget)
local container = wrap_and_add(name, parent, bg) local container = wrap_and_add(name, parent, bg, widget)
vicious.register(widget, vicious.widgets.mdir, function(widget, args) vicious.register(widget, vicious.widgets.mdir, function(widget, args)
if args[1] > 0 then if args[1] > 0 then
naughty.notify({ naughty.notify({
title = "New mail arrived in box " .. title, title = "New mail arrived in box " .. title,
text = title " "..args[2].." / "..args[1], text = title .. " " ..args[2].." / "..args[1],
position = notify_pos or "top_left" position = notify_pos or "top_left"
}) })
@ -203,7 +203,7 @@ local function taglistwidget(name, parent) --{{{
end end
-- Create a taglist widget -- Create a taglist widget
return wrap_and_add(name, parent, return wrap_and_add(name, parent,
awful.widget.taglist(parent.screen, filter_urgentonly, mytaglist.buttons) awful.widget.taglist(parent.screen, awful.widget.taglist.filter.noempty, mytaglist.buttons)
) )
end --}}} end --}}}
widgets.add.taglist = taglistwidget widgets.add.taglist = taglistwidget