-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua.example
More file actions
251 lines (223 loc) · 8.52 KB
/
Copy pathinit.lua.example
File metadata and controls
251 lines (223 loc) · 8.52 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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
-- SirenWM full configuration example
-- Copy to ~/.config/sirenwm/init.lua and adjust to your setup.
-- ============================================================
-- MODULES
-- require() returns the module's API table.
-- Available C++ modules: "keybindings", "bar", "keyboard", "sysinfo"
-- Optional: "debug_ui" (requires -DSIRENWM_DEBUG_UI=ON)
-- Lua stdlib modules (from ~/.config/sirenwm/ or system):
-- require("rules") — declarative window rules
-- require("wallpaper") — per-monitor wallpapers via xwallpaper
-- require("autostart") — managed child processes
-- ============================================================
-- Core modules (required — WM is unusable without these)
local kb = require("keybindings")
local bar = require("bar")
-- Optional modules (siren.load returns null-object on failure)
local kbd = siren.load("keyboard")
local dbg = siren.load("debug_ui")
local rules = siren.load("rules")
local wallpaper = siren.load("wallpaper")
local autostart = siren.load("autostart")
-- ============================================================
-- WIDGETS
-- siren.load() returns a null-object if the widget module is missing,
-- so the bar simply renders nothing for that slot.
-- Custom: Widget:new({ interval = N, render = function(self) ... end })
-- See lua/swm/widget.lua for the base class.
-- ============================================================
local tags = siren.load("widgets.tags")
local title = siren.load("widgets.title")
local tray = siren.load("widgets.tray")
local clock = siren.load("widgets.clock")
local sysinfo = siren.load("widgets.sysinfo")
local kbdw = siren.load("widgets.kbd")
-- ============================================================
-- MODIFIER KEY
-- mod4 = Super/Win, mod1 = Alt, mod3 = Hyper
-- ============================================================
siren.modifier = "mod4"
-- ============================================================
-- MONITORS
-- Pin specific outputs to named aliases. Use `xrandr` to list
-- output names. If omitted, monitors are auto-detected.
-- ============================================================
siren.monitors = {
{
name = "primary",
output = "HDMI-1",
width = 1920,
height = 1080,
refresh = 60,
rotation = "normal",
enabled = true,
},
{
name = "secondary",
output = "HDMI-0",
width = 900,
height = 1600,
refresh = 60,
rotation = "left",
enabled = true,
},
}
siren.compose_monitors = {
primary = "primary",
layout = {
{ monitor = "secondary", relative_to = "primary", side = "right", shift = 0 },
},
}
-- ============================================================
-- WORKSPACES
-- ============================================================
siren.workspaces = {
{ name = "[1]", monitor = "primary" },
{ name = "[2] Web", monitor = "primary" },
{ name = "[3] Code", monitor = "primary" },
{ name = "[4]", monitor = "primary" },
{ name = "[5]", monitor = "primary" },
{ name = "[6]", monitor = "secondary" },
{ name = "[7]", monitor = "secondary" },
{ name = "[8]", monitor = "secondary" },
{ name = "[9]", monitor = "secondary" },
}
-- ============================================================
-- THEME
-- ============================================================
siren.theme = {
font = "monospace:size=9",
bg = "#111111",
fg = "#bbbbbb",
alt_bg = "#222222",
alt_fg = "#eeeeee",
accent = "#005577",
gap = 4,
dpi = 0,
cursor_size = 16,
cursor_theme = "default",
border = {
thickness = 1,
focused = "#005577",
unfocused = "#222222",
},
}
-- ============================================================
-- KEYBOARD
-- ============================================================
kbd.settings = {
layouts = "us,ru",
options = "grp:alt_shift_toggle,terminate:ctrl_alt_bksp",
}
-- ============================================================
-- MOUSE DRAG BINDINGS
-- ============================================================
kb.mouse = {
{ "mod+Button1", "move" },
{ "mod+Button3", "resize" },
{ "mod+Button2", "float" },
}
-- ============================================================
-- STATUS BAR
-- Assign bar.settings to configure top and/or bottom bars.
-- Slots accept Widget objects (with render()) or builtins
-- (tags, title, tray).
-- ============================================================
bar.settings = {
top = {
height = 18,
left = { tags },
center = { title },
right = { tray, sysinfo, clock },
-- Per-bar color overrides (optional, inherits from theme):
-- colors = {
-- bar_bg = "#111111",
-- normal_fg = "#bbbbbb",
-- focused_bg = "#005577",
-- focused_fg = "#eeeeee",
-- },
},
bottom = {
height = 18,
left = { clock },
center = {},
right = { kbdw },
},
}
-- ============================================================
-- WALLPAPER
-- ============================================================
wallpaper.settings = {
primary = { image = "~/wallpapers/main.jpg", mode = "zoom" },
secondary = { image = "~/wallpapers/secondary.png", mode = "stretch" },
}
-- ============================================================
-- AUTOSTART
-- ============================================================
autostart.settings = {
{ cmd = "picom --experimental-backends", policy = "once" },
{ cmd = "dunst", policy = "once" },
}
-- ============================================================
-- WINDOW RULES
-- ============================================================
rules.settings = {
{ class = "firefox", workspace = 2 },
{ class = "code", workspace = 3 },
{ class = "steam", float = true },
{ class = "pavucontrol", float = true },
{ instance = "gimp", float = true },
{ class = "mpv", float = true },
}
-- ============================================================
-- KEYBINDINGS
-- ============================================================
local binds = {
{ "mod+Return", function() siren.spawn("xterm") end },
{ "mod+p", function()
local t = siren.theme
local m = siren.monitor.focused()
siren.spawn(string.format(
"dmenu_run -m %d -fn '%s' -nb '%s' -nf '%s' -sb '%s' -sf '%s'",
m.index, t.font, t.bg, t.fg, t.accent, t.bg))
end },
{ "mod+shift+q", function() siren.win.close() end },
{ "mod+j", function() siren.win.focus_next() end },
{ "mod+k", function() siren.win.focus_prev() end },
{ "mod+shift+Return", function() siren.layout.zoom() end },
{ "mod+shift+space", function() siren.win.toggle_floating() end },
{ "mod+h", function() siren.layout.adj_master(-0.05) end },
{ "mod+l", function() siren.layout.adj_master( 0.05) end },
{ "mod+i", function() siren.layout.inc_master( 1) end },
{ "mod+d", function() siren.layout.inc_master(-1) end },
{ "mod+m", function() siren.layout.set("monocle") end },
{ "mod+t", function() siren.layout.set("tile") end },
{ "mod+r", function() siren.reload() end },
{ "mod+shift+r", function() siren.restart() end },
{ "mod+shift+m", function()
local mons = siren.monitor.list()
local cur = siren.monitor.focused()
if #mons < 2 then return end
local next_idx = (cur.index % #mons) + 1
siren.win.move_to_monitor(next_idx)
siren.monitor.focus(next_idx)
end },
{ "mod+F12", function() dbg.toggle() end },
}
for i = 1, 9 do
table.insert(binds, { "mod+" .. i, function() siren.ws.switch(i) end })
table.insert(binds, { "mod+shift+" .. i, function() siren.win.move_to(i) end })
end
for i = 1, 8 do
table.insert(binds, { "mod+ctrl+" .. i, function() siren.monitor.focus(i) end })
table.insert(binds, { "mod+ctrl+shift+" .. i, function() siren.win.move_to_monitor(i) end })
end
local apps = {
{ key = "mod+shift+b", cmd = "librewolf" },
{ key = "mod+shift+f", cmd = "thunar" },
{ key = "mod+shift+d", cmd = "vesktop" },
}
for _, app in ipairs(apps) do
table.insert(binds, { app.key, function() siren.spawn(app.cmd) end })
end
kb.binds = binds