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