2 local utils = require("utils")
4 -- Widget and layout library
5 local wibox = require("wibox")
7 -- Create a textclock widget
8 separator = wibox.widget.textbox()
9 separator:set_markup('<span font="Symbola 10" color="#404040">│</span>')
12 -- Create a wibox for each screen and add it
17 mytaglist.buttons = awful.util.table.join(
18 awful.button({ }, 1, awful.tag.viewonly),
19 awful.button({ modkey }, 1, awful.client.movetotag),
20 awful.button({ }, 3, awful.tag.viewtoggle),
21 awful.button({ modkey }, 3, awful.client.toggletag),
22 awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
23 awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
26 mytasklist.buttons = awful.util.table.join(
27 awful.button({ }, 1, function (c)
28 if c == client.focus then
31 -- Without this, the following
32 -- :isvisible() makes no sense
34 if not c:isvisible() then
35 awful.tag.viewonly(c:tags()[1])
37 -- This will also un-minimize
38 -- the client, if needed
43 awful.button({ }, 2, function (c) c:kill() end),
44 awful.button({ }, 3, function ()
49 instance = awful.menu.clients({ width=250 })
52 awful.button({ }, 4, function ()
53 awful.client.focus.byidx(1)
54 if client.focus then client.focus:raise() end
56 awful.button({ }, 5, function ()
57 awful.client.focus.byidx(-1)
58 if client.focus then client.focus:raise() end
62 awful.screen.connect_for_each_screen(function(s)
63 -- Create a promptbox for each screen
64 s.mypromptbox = awful.widget.prompt()
65 -- Create an imagebox widget which will contains an icon indicating which layout we're using.
66 -- We need one layoutbox per screen.
67 s.mylayoutbox = awful.widget.layoutbox(s)
68 s.mylayoutbox:buttons(awful.util.table.join(
69 awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
70 awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
71 awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
72 awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
73 -- Create a taglist widget
74 s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
76 -- Create a tasklist widget
77 s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
80 s.mywibox = awful.wibox({ position = "top", screen = s })
82 -- Widgets that are aligned to the left
83 local left_layout = wibox.layout.fixed.horizontal()
84 -- left_layout:add(mylauncher)
85 left_layout:add(s.mytaglist)
86 left_layout:add(s.mypromptbox)
88 -- Widgets that are aligned to the right
89 local right_layout = wibox.layout.fixed.horizontal()
90 right_layout:add(wibox.widget.systray())
91 right_layout:add(separator)
92 right_layout:add(require("widgets/awesompd"))
93 right_layout:add(require("widgets/volume_widget"))
94 if utils.has_battery() then
95 right_layout:add(separator)
96 right_layout:add(require("widgets/battery_widget"))
98 right_layout:add(separator)
99 right_layout:add(require("widgets/network_widget"))
100 right_layout:add(separator)
101 right_layout:add(require("widgets/calendar"))
102 right_layout:add(s.mylayoutbox)
104 -- Now bring it all together (with the tasklist in the middle)
105 local layout = wibox.layout.align.horizontal()
106 layout:set_left(left_layout)
107 layout:set_middle(s.mytasklist)
108 layout:set_right(right_layout)
110 s.mywibox:set_widget(layout)