forked from worron/awesome-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc-colorless.lua
180 lines (138 loc) · 6.68 KB
/
rc-colorless.lua
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
-----------------------------------------------------------------------------------------------------------------------
-- Colorless config --
-----------------------------------------------------------------------------------------------------------------------
-- Load modules
-----------------------------------------------------------------------------------------------------------------------
-- Standard awesome library
------------------------------------------------------------
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
require("awful.autofocus")
-- User modules
------------------------------------------------------------
local redflat = require("redflat")
-- Error handling
-----------------------------------------------------------------------------------------------------------------------
require("colorless.ercheck-config") -- load file with error handling
-- Setup theme and environment vars
-----------------------------------------------------------------------------------------------------------------------
local env = require("colorless.env-config") -- load file with environment
env:init()
-- Layouts setup
-----------------------------------------------------------------------------------------------------------------------
local layouts = require("colorless.layout-config") -- load file with tile layouts setup
layouts:init()
-- Main menu configuration
-----------------------------------------------------------------------------------------------------------------------
local mymenu = require("colorless.menu-config") -- load file with menu configuration
mymenu:init({ env = env })
-- Panel widgets
-----------------------------------------------------------------------------------------------------------------------
-- Separator
--------------------------------------------------------------------------------
local separator = redflat.gauge.separator.vertical()
-- Tasklist
--------------------------------------------------------------------------------
local tasklist = {}
tasklist.buttons = awful.util.table.join(
awful.button({}, 1, redflat.widget.tasklist.action.select),
awful.button({}, 2, redflat.widget.tasklist.action.close),
awful.button({}, 3, redflat.widget.tasklist.action.menu),
awful.button({}, 4, redflat.widget.tasklist.action.switch_next),
awful.button({}, 5, redflat.widget.tasklist.action.switch_prev)
)
-- Taglist widget
--------------------------------------------------------------------------------
local taglist = {}
taglist.style = { widget = redflat.gauge.tag.orange.new, show_tip = true }
taglist.buttons = awful.util.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ env.mod }, 1, function(t) if client.focus then client.focus:move_to_tag(t) end end),
awful.button({ }, 2, awful.tag.viewtoggle),
awful.button({ }, 3, function(t) redflat.widget.layoutbox:toggle_menu(t) end),
awful.button({ env.mod }, 3, function(t) if client.focus then client.focus:toggle_tag(t) end end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
-- Textclock widget
--------------------------------------------------------------------------------
local textclock = {}
textclock.widget = redflat.widget.textclock({ timeformat = "%H:%M", dateformat = "%b %d %a" })
-- Layoutbox configure
--------------------------------------------------------------------------------
local layoutbox = {}
layoutbox.buttons = awful.util.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () redflat.widget.layoutbox:toggle_menu(mouse.screen.selected_tag) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)
)
-- Tray widget
--------------------------------------------------------------------------------
local tray = {}
tray.widget = redflat.widget.minitray()
tray.buttons = awful.util.table.join(
awful.button({}, 1, function() redflat.widget.minitray:toggle() end)
)
-- Screen setup
-----------------------------------------------------------------------------------------------------------------------
awful.screen.connect_for_each_screen(
function(s)
-- wallpaper
env.wallpaper(s)
-- tags
awful.tag({ "Tag1", "Tag2", "Tag3", "Tag4", "Tag5" }, s, awful.layout.layouts[1])
-- layoutbox widget
layoutbox[s] = redflat.widget.layoutbox({ screen = s })
-- taglist widget
taglist[s] = redflat.widget.taglist({ screen = s, buttons = taglist.buttons, hint = env.tagtip }, taglist.style)
-- tasklist widget
tasklist[s] = redflat.widget.tasklist({ screen = s, buttons = tasklist.buttons })
-- panel wibox
s.panel = awful.wibar({ position = "bottom", screen = s, height = beautiful.panel_height or 36 })
-- add widgets to the wibox
s.panel:setup {
layout = wibox.layout.align.horizontal,
{ -- left widgets
layout = wibox.layout.fixed.horizontal,
env.wrapper(mymenu.widget, "mainmenu", mymenu.buttons),
separator,
env.wrapper(taglist[s], "taglist"),
separator,
s.mypromptbox,
},
{ -- middle widget
layout = wibox.layout.align.horizontal,
expand = "outside",
nil,
env.wrapper(tasklist[s], "tasklist"),
},
{ -- right widgets
layout = wibox.layout.fixed.horizontal,
separator,
env.wrapper(layoutbox[s], "layoutbox", layoutbox.buttons),
separator,
env.wrapper(textclock.widget, "textclock"),
separator,
env.wrapper(tray.widget, "tray", tray.buttons),
},
}
end
)
-- Key bindings
-----------------------------------------------------------------------------------------------------------------------
local hotkeys = require("colorless.keys-config") -- load file with hotkeys configuration
hotkeys:init({ env = env, menu = mymenu.mainmenu })
-- Rules
-----------------------------------------------------------------------------------------------------------------------
local rules = require("colorless.rules-config") -- load file with rules configuration
rules:init({ hotkeys = hotkeys})
-- Titlebar setup
-----------------------------------------------------------------------------------------------------------------------
local titlebar = require("colorless.titlebar-config") -- load file with titlebar configuration
titlebar:init()
-- Base signal set for awesome wm
-----------------------------------------------------------------------------------------------------------------------
local signals = require("colorless.signals-config") -- load file with signals configuration
signals:init({ env = env })