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>')
11 local function client_menu_toggle_fn()
15 if instance and instance.wibox.visible then
19 instance = awful.menu.clients({ theme = { width = 250 } })
25 -- Create a wibox for each screen and add it
26 local taglist_buttons = awful.util.table.join(
27 awful.button({ }, 1, function(t) t:view_only() end),
28 awful.button({ modkey }, 1, function(t)
30 client.focus:move_to_tag(t)
33 awful.button({ }, 3, awful.tag.viewtoggle),
34 awful.button({ modkey }, 3, function(t)
36 client.focus:toggle_tag(t)
39 awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
40 awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
43 local tasklist_buttons = awful.util.table.join(
44 awful.button({ }, 1, function (c)
45 if c == client.focus then
48 -- Without this, the following
49 -- :isvisible() makes no sense
51 if not c:isvisible() and c.first_tag then
52 c.first_tag:view_only()
54 -- This will also un-minimize
55 -- the client, if needed
60 awful.button({ }, 2, function (c) c:kill() end),
61 awful.button({ }, 3, client_menu_toggle_fn()),
62 awful.button({ }, 4, function ()
63 awful.client.focus.byidx(1)
65 awful.button({ }, 5, function ()
66 awful.client.focus.byidx(-1)
70 awful.screen.connect_for_each_screen(function(s)
71 -- Create a promptbox for each screen
72 s.mypromptbox = awful.widget.prompt()
73 -- Create an imagebox widget which will contains an icon indicating which layout we're using.
74 -- We need one layoutbox per screen.
75 s.mylayoutbox = awful.widget.layoutbox(s)
76 s.mylayoutbox:buttons(awful.util.table.join(
77 awful.button({ }, 1, function () awful.layout.inc( 1) end),
78 awful.button({ }, 3, function () awful.layout.inc(-1) end),
79 awful.button({ }, 4, function () awful.layout.inc( 1) end),
80 awful.button({ }, 5, function () awful.layout.inc(-1) end)))
81 -- Create a taglist widget
82 s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
84 -- Create a tasklist widget
85 s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)
88 s.mywibox = awful.wibar({ position = "top", screen = s })
90 -- Add widgets to the wibox
92 layout = wibox.layout.align.horizontal,
94 layout = wibox.layout.fixed.horizontal,
98 s.mytasklist, -- Middle widget
100 layout = wibox.layout.fixed.horizontal,
102 wibox.widget.systray(),
104 require("widgets/pomodoro"),
106 require("widgets/awesompd"),
107 require("widgets/volume_widget"),
108 utils.has_battery() and {
109 layout = wibox.layout.fixed.horizontal,
111 require("widgets/battery_widget"),
114 require("widgets/network_widget"),
116 require("widgets/calendar"),