1 -- Widget and layout library
2 wibox = require("wibox")
7 -- Create a textclock widget
8 mytextclock = awful.widget.textclock()
10 -- Create a wibox for each screen and add it
15 mytaglist.buttons = awful.util.table.join(
16 awful.button({ }, 1, awful.tag.viewonly),
17 awful.button({ modkey }, 1, awful.client.movetotag),
18 awful.button({ }, 3, awful.tag.viewtoggle),
19 awful.button({ modkey }, 3, awful.client.toggletag),
20 awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
21 awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
24 mytasklist.buttons = awful.util.table.join(
25 awful.button({ }, 1, function (c)
26 if c == client.focus then
29 -- Without this, the following
30 -- :isvisible() makes no sense
32 if not c:isvisible() then
33 awful.tag.viewonly(c:tags()[1])
35 -- This will also un-minimize
36 -- the client, if needed
41 awful.button({ }, 2, function (c) c:kill() end),
42 awful.button({ }, 3, function ()
47 instance = awful.menu.clients({ width=250 })
50 awful.button({ }, 4, function ()
51 awful.client.focus.byidx(1)
52 if client.focus then client.focus:raise() end
54 awful.button({ }, 5, function ()
55 awful.client.focus.byidx(-1)
56 if client.focus then client.focus:raise() end
60 for s = 1, screen.count() do
61 -- Create a promptbox for each screen
62 mypromptbox[s] = awful.widget.prompt()
63 -- Create an imagebox widget which will contains an icon indicating which layout we're using.
64 -- We need one layoutbox per screen.
65 mylayoutbox[s] = awful.widget.layoutbox(s)
66 mylayoutbox[s]:buttons(awful.util.table.join(
67 awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
68 awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
69 awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
70 awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
71 -- Create a taglist widget
72 mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
74 -- Create a tasklist widget
75 mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
78 mywibox[s] = awful.wibox({ position = "top", screen = s })
80 -- Widgets that are aligned to the left
81 local left_layout = wibox.layout.fixed.horizontal()
82 left_layout:add(mylauncher)
83 left_layout:add(mytaglist[s])
84 left_layout:add(mypromptbox[s])
86 -- Widgets that are aligned to the right
87 local right_layout = wibox.layout.fixed.horizontal()
88 if s == 1 then right_layout:add(wibox.widget.systray()) end
89 --right_layout:add(APW)
90 right_layout:add(volwidget)
91 right_layout:add(mytextclock)
92 right_layout:add(mylayoutbox[s])
94 -- Now bring it all together (with the tasklist in the middle)
95 local layout = wibox.layout.align.horizontal()
96 layout:set_left(left_layout)
97 layout:set_middle(mytasklist[s])
98 layout:set_right(right_layout)
100 mywibox[s]:set_widget(layout)