I'd better attach my wiboxes.lua. See attachment below.
Regards,
Bill Sun
-- Module: wiboxes.lua
-- vim:fdm=marker
require("modules.widgets")
-- Create a textclock widget
textclock = awful.widget.textclock({ align = "right" })
-- Create a systray
systray = widget({ type = "systray" })
-- Create a wibox for each screen and add it
wibox_top = {}
wibox_bottom = {}
promptbox = {}
layoutbox = {}
taglist = {}
taglist.buttons = awful.util.table.join(
awful.button({ }, 1, awful.tag.viewonly),
awful.button({ modkey }, 1, awful.client.movetotag))
tasklist = {}
tasklist.buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
if not c:isvisible() then
awful.tag.viewonly(c:tags()[1])
end
client.focus = c
c:raise()
end),
awful.button({ }, 3, function ()
if instance then
instance:hide()
instance = nil
end
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end))
for s = 1, screen.count() do
-- Create a promptbox for each screen
promptbox[s] = awful.widget.prompt({ layout =
awful.widget.layout.horizontal.leftright })
-- Create an imagebox widget which will contains an icon indicating which
layout we're using
layoutbox[s] = awful.widget.layoutbox(s)
layoutbox[s]:buttons(awful.util.table.join(
awful.button({ }, 1, function ()
awful.layout.inc(layouts, 1) end),
awful.button({ }, 3, function ()
awful.layout.inc(layouts, -1) end),
awful.button({ }, 4, function ()
awful.layout.inc(layouts, 1) end),
awful.button({ }, 5, function ()
awful.layout.inc(layouts, -1) end)))
-- Create a taglist widget
taglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all,
taglist.buttons)
-- Create a tasklist widget
tasklist[s] = awful.widget.tasklist(function(c)
-- Remove tasklist icons without modifying the original tasklist.lua
local tmp_task = { awful.widget.tasklist.label.currenttags(c, s) }
return tmp_task[1], tmp_task[2], tmp_task[3], nil
end, tasklist.buttons)
-- Create the wibox
wibox_top[s] = awful.wibox({ position = "top", screen = s })
wibox_bottom[s] = awful.wibox({ position = "bottom", screen = s })
-- Add widgets to the wibox - order matters
wibox_top[s].widgets = {
{
taglist[s],
spacer,
promptbox[s],
layout = awful.widget.layout.horizontal.leftright
},
layoutbox[s],
s == 1 and systray or nil,
second_textclock, spacer_single,
mail_widget, spacer,
bat_widget, spacer,
mem_widget, spacer,
cpu_widget, spacer,
thermal_widget, spacer,
layout = awful.widget.layout.horizontal.rightleft
}
-- Another wibox for tasklist (at the bottom of the screen)
wibox_bottom[s].widgets = {
tasklist[s],
layout = awful.widget.layout.horizontal.leftright
}
end