-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path06_creation.lua
More file actions
129 lines (122 loc) · 3.44 KB
/
06_creation.lua
File metadata and controls
129 lines (122 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
-- Created by IntelliJ IDEA.
-- User: alexander
-- Date: 2/15/12
-- Time: 5:54 PM
-- To change this template use File | Settings | File Templates.
--
-- Create a wibox for each screen and add it
-- thing on top
mywibox = {}
-- thing at bottom
myinfobox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons =
awful.util.table.join(
awful.button({}, 1, awful.tag.viewonly),
awful.button({ modkey }, 1, awful.client.movetotag),
awful.button({}, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, awful.client.toggletag),
awful.button({}, 4, awful.tag.viewnext),
awful.button({}, 5, awful.tag.viewprev)
)
mytasklist = {}
mytasklist.buttons = awful.util.table.join(awful.button({}, 1, function(c)
if c == client.focus then
c.minimized = true
else
if not c:isvisible() then
awful.tag.viewonly(c:tags()[1])
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end),
awful.button({}, 3, function()
if instance then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ width = 250 })
end
end),
awful.button({}, 4, function()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
awful.button({}, 5, function()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end))
for s = 1, screen.count() do
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
mylayoutbox[s] = awful.widget.layoutbox(s)
mylayoutbox[s]:buttons(awful.util.table.join(awful.button({}, 1, function() awful.layout.inc(layouts, 1) end),
awful.button({}, 3, 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)))
-- Create a taglist widget
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
-- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist(function(c)
return awful.widget.tasklist.label.currenttags(c, s)
end, mytasklist.buttons)
-- TOP PANEL CREATION
-- Create the wibox
mywibox[s] = awful.wibox({ position = "top", screen = s })
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
{
mylauncher,
separator,
mytaglist[s],
separator,
mypromptbox[s],
separator,
layout = awful.widget.layout.horizontal.leftright
},
mylayoutbox[s],
separator,
mytextclock,
separator,
kbdcfg.widget,
separator,
s == 1 and mysystray or nil,
separator,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
}
-- BOTTOM PANEL CREATION
-- Create the infobox
myinfobox[s] = awful.wibox({ position = "bottom", screen = s })
-- Add widgets to the infobox - order matters
myinfobox[s].widgets = {
{
mpdwidget,
layout = awful.widget.layout.horizontal.leftright
},
volwidget,
separator,
netwidget,
separator,
netdownwidget,
separator,
netupwidget,
separator,
cpuwidget,
separator,
memwidget,
separator,
fshwidget,
fsrwidget,
layout=awful.widget.layout.horizontal.rightleft
}
end
-- }}}