2 -- Create a textclock widget
3 mytextclock = awful.widget.textclock()
5 -- Create a wibox for each screen and add it
10 mytaglist.buttons = awful.util.table.join(
11 awful.button({ }, 1, awful.tag.viewonly),
12 awful.button({ modkey }, 1, awful.client.movetotag),
13 awful.button({ }, 3, awful.tag.viewtoggle),
14 awful.button({ modkey }, 3, awful.client.toggletag),
15 awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
16 awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
19 mytasklist.buttons = awful.util.table.join(
20 awful.button({ }, 1, function (c)
21 if c == client.focus then
24 -- Without this, the following
25 -- :isvisible() makes no sense
27 if not c:isvisible() then
28 awful.tag.viewonly(c:tags()[1])
30 -- This will also un-minimize
31 -- the client, if needed
36 awful.button({ }, 2, function (c) c:kill() end),
37 awful.button({ }, 3, function ()
42 instance = awful.menu.clients({ width=250 })
45 awful.button({ }, 4, function ()
46 awful.client.focus.byidx(1)
47 if client.focus then client.focus:raise() end
49 awful.button({ }, 5, function ()
50 awful.client.focus.byidx(-1)
51 if client.focus then client.focus:raise() end
55 for s = 1, screen.count() do
56 -- Create a promptbox for each screen
57 mypromptbox[s] = awful.widget.prompt()
58 -- Create an imagebox widget which will contains an icon indicating which layout we're using.
59 -- We need one layoutbox per screen.
60 mylayoutbox[s] = awful.widget.layoutbox(s)
61 mylayoutbox[s]:buttons(awful.util.table.join(
62 awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
63 awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
64 awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
65 awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
66 -- Create a taglist widget
67 mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
69 -- Create a tasklist widget
70 mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
73 mywibox[s] = awful.wibox({ position = "top", screen = s })
75 -- Widgets that are aligned to the left
76 local left_layout = wibox.layout.fixed.horizontal()
77 left_layout:add(mylauncher)
78 left_layout:add(mytaglist[s])
79 left_layout:add(mypromptbox[s])
81 -- Widgets that are aligned to the right
82 local right_layout = wibox.layout.fixed.horizontal()
83 if s == 1 then right_layout:add(wibox.widget.systray()) end
84 --right_layout:add(APW)
85 right_layout:add(mytextclock)
86 right_layout:add(mylayoutbox[s])
88 -- Now bring it all together (with the tasklist in the middle)
89 local layout = wibox.layout.align.horizontal()
90 layout:set_left(left_layout)
91 layout:set_middle(mytasklist[s])
92 layout:set_right(right_layout)
94 mywibox[s]:set_widget(layout)