Awesome update 3

master
Ambrevar 2012-12-31 11:41:14 +01:00
parent 8816e8bc33
commit 591c45e7dc
1 changed files with 31 additions and 23 deletions

View File

@ -114,8 +114,7 @@ separator_date:set_text(" |")
systraywidget = wibox.widget.systray()
-- Clock
clockwidget = wibox.widget.textbox()
clockwidget:set_text("DATE")
mytextclock = awful.widget.textclock()
cpuwidget = wibox.widget.textbox()
netwidget = wibox.widget.textbox()
@ -234,7 +233,7 @@ mytasklist.buttons = awful.util.table.join(
for s = 1, screen.count() do
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
mypromptbox[s] = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
@ -245,32 +244,41 @@ for s = 1, screen.count() do
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
-- Create a taglist widget
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
-- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
-- Create the wibox
mywibox[s] = awful.wibox({ position = "top", screen = s })
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
{
mylayoutbox[s],
mytaglist[s],
mypromptbox[s],
layout = awful.widget.layout.horizontal.leftright
},
s == 1 and systraywidget or nil,
clockwidget,
separator_date,
cpuwidget,
netwidget,
volpwidget,
volmwidget,
batwidget,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
}
-- Widgets that are aligned to the left
local left_layout = wibox.layout.fixed.horizontal()
left_layout:add(mylauncher)
left_layout:add(mytaglist[s])
left_layout:add(mypromptbox[s])
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
if s == 1 then right_layout:add(wibox.widget.systray()) end
right_layout:add(mytextclock)
right_layout:add(mylayoutbox[s])
-- clockwidget,
-- separator_date,
-- cpuwidget,
-- netwidget,
-- volpwidget,
-- volmwidget,
-- batwidget,
-- Now bring it all together (with the tasklist in the middle)
local layout = wibox.layout.align.horizontal()
layout:set_left(left_layout)
layout:set_middle(mytasklist[s])
layout:set_right(right_layout)
mywibox[s]:set_widget(layout)
end
--------------------------------------------------------------------------------