debian-btw

debian-btw

https://git.tonybtw.com/debian-btw.git git://git.tonybtw.com/debian-btw.git
11,496 bytes raw
1
---@meta
2
-------------------------------------------------------------------------------
3
-- OXWM Configuration File
4
-------------------------------------------------------------------------------
5
6
---Load type definitions for LSP
7
---@module 'oxwm'
8
9
-------------------------------------------------------------------------------
10
-- Variables
11
-------------------------------------------------------------------------------
12
-- Define your variables here for easy customization throughout the config.
13
-- This makes it simple to change keybindings, colors, and settings in one place.
14
15
-- Modifier key: "Mod4" is the Super/Windows key, "Mod1" is Alt
16
local modkey = "Mod1"
17
18
-- Terminal emulator command (defualts to alacritty)
19
local terminal = "alacritty"
20
21
-- Color palette - customize these to match your theme
22
-- Alternatively you can import other files in here, such as
23
-- local colors = require("colors.lua") and make colors.lua a file
24
-- in the ~/.config/oxwm directory
25
-- local colors = require("tokyonight");
26
local colors = require("colors.custom-colors");
27
28
local tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }
29
-- local tags = { "", "󰊯", "", "󰰏", "󰟿", "󱇤", "", "󱘶", "󰧮" } -- Example of nerd font icon tags
30
31
local bar_font = "UbuntuMono Nerd Font Propo:style=Bold:size=12"
32
33
local blocks = {
34
    oxwm.bar.block.shell({
35
        format = " {}",
36
        command = "uname -r",
37
        interval = 999999999,
38
        color = colors.red,
39
        underline = true,
40
    }),
41
    oxwm.bar.block.static({
42
        text = "│",
43
        interval = 999999999,
44
        color = colors.sep,
45
        underline = false,
46
    }),
47
    oxwm.bar.block.ram({
48
        format = "󰍛 Ram: {used}/{total} GB",
49
        interval = 5,
50
        color = colors.light_blue,
51
        underline = true,
52
    }),
53
    oxwm.bar.block.static({
54
        text = "│",
55
        interval = 999999999,
56
        color = colors.sep,
57
        underline = false,
58
    }),
59
    oxwm.bar.block.datetime({
60
        format = "󰸘 {}",
61
        date_format = "%a, %b %d - %-I:%M %P",
62
        interval = 1,
63
        color = colors.cyan,
64
        underline = true,
65
    }),
66
    -- Uncomment to add battery status (useful for laptops)
67
    -- oxwm.bar.block.battery({
68
    --     format = "Bat: {}%",
69
    --     charging = "⚡ Bat: {}%",
70
    --     discharging = "- Bat: {}%",
71
    --     full = "✓ Bat: {}%",
72
    --     interval = 30,
73
    --     color = colors.green,
74
    --     underline = true,
75
    -- }),
76
};
77
78
-------------------------------------------------------------------------------
79
-- Basic Settings
80
-------------------------------------------------------------------------------
81
oxwm.set_terminal(terminal)
82
oxwm.set_modkey(modkey)
83
oxwm.set_tags(tags)
84
85
-------------------------------------------------------------------------------
86
-- Layouts
87
-------------------------------------------------------------------------------
88
oxwm.set_layout_symbol("tiling", "[T]")
89
oxwm.set_layout_symbol("normie", "[F]")
90
oxwm.set_layout_symbol("tabbed", "[=]")
91
92
-------------------------------------------------------------------------------
93
-- Appearance
94
-------------------------------------------------------------------------------
95
oxwm.border.set_width(0)
96
oxwm.border.set_focused_color(colors.purple)
97
oxwm.border.set_unfocused_color(colors.grey)
98
99
-- Smart Enabled = No border if 1 window
100
oxwm.gaps.set_smart(false)
101
-- Inner gaps (horizontal, vertical) in pixels
102
oxwm.gaps.set_inner(5, 5)
103
-- Outer gaps (horizontal, vertical) in pixels
104
oxwm.gaps.set_outer(5, 5)
105
106
-------------------------------------------------------------------------------
107
-- Window Rules
108
-------------------------------------------------------------------------------
109
-- Rules allow you to automatically configure windows based on their properties
110
-- You can match windows by class, instance, title, or role
111
-- Available properties: floating, tag, fullscreen, etc.
112
--
113
-- Common use cases:
114
-- - Force floating for certain applications (dialogs, utilities)
115
-- - Send specific applications to specific workspaces
116
-- - Configure window behavior based on title or class
117
118
-- Examples (uncomment to use):
119
oxwm.rule.add({ instance = "gimp", floating = true })
120
oxwm.rule.add({ instance = "brave-browser", tag = 2 })
121
oxwm.rule.add({ class = "firefox", tag = 3 })
122
oxwm.rule.add({ instance = "slack", tag = 4 })
123
oxwm.rule.add({ instance = "discord", tag = 5 })
124
125
-- To find window properties, use xprop and click on the window
126
-- WM_CLASS(STRING) shows both instance and class (instance, class)
127
128
-------------------------------------------------------------------------------
129
-- Status Bar Configuration
130
-------------------------------------------------------------------------------
131
-- Font configuration
132
oxwm.bar.set_font(bar_font)
133
134
-- Set your blocks here (defined above)
135
oxwm.bar.set_blocks(blocks)
136
137
-- Bar color schemes (for workspace tag display)
138
-- Parameters: foreground, background, border
139
140
-- Unoccupied tags
141
oxwm.bar.set_scheme_normal(colors.fg, colors.bg, "#444444")
142
-- Occupied tags
143
oxwm.bar.set_scheme_occupied(colors.blue, colors.bg, colors.cyan)
144
-- Currently selected tag
145
oxwm.bar.set_scheme_selected(colors.blue, colors.bg, colors.purple)
146
147
-------------------------------------------------------------------------------
148
-- Keybindings
149
-------------------------------------------------------------------------------
150
-- Basic window management
151
152
oxwm.key.bind({ modkey }, "Return", oxwm.spawn_terminal())
153
-- Launch Dmenu
154
-- oxwm.key.bind({ modkey }, "D", oxwm.spawn({ "sh", "-c", "dmenu_run -l 10" }))
155
oxwm.key.bind({ modkey }, "D", oxwm.spawn({ "sh", "-c", "rofi -show drun" }))
156
-- Copy screenshot to clipboard
157
oxwm.key.bind({ modkey }, "S", oxwm.spawn({ "sh", "-c", "maim -s | xclip -selection clipboard -t image/png" }))
158
oxwm.key.bind({ modkey }, "Q", oxwm.client.kill())
159
160
-- Keybind overlay - Shows important keybindings on screen
161
oxwm.key.bind({ modkey, "Shift" }, "Slash", oxwm.show_keybinds())
162
163
-- Window state toggles
164
oxwm.key.bind({ modkey, "Shift" }, "F", oxwm.client.toggle_fullscreen())
165
oxwm.key.bind({ modkey, "Shift" }, "Space", oxwm.client.toggle_floating())
166
167
-- Layout management
168
oxwm.key.bind({ modkey }, "C", oxwm.layout.set("tiling"))
169
-- Cycle through layouts
170
oxwm.key.bind({ modkey }, "N", oxwm.layout.cycle())
171
172
-- Master area controls (tiling layout)
173
174
-- Decrease/Increase master area width
175
oxwm.key.bind({ modkey }, "H", oxwm.set_master_factor(-5))
176
oxwm.key.bind({ modkey }, "L", oxwm.set_master_factor(5))
177
-- Increment/Decrement number of master windows
178
oxwm.key.bind({ modkey }, "I", oxwm.inc_num_master(1))
179
oxwm.key.bind({ modkey }, "P", oxwm.inc_num_master(-1))
180
181
-- Gaps toggle
182
oxwm.key.bind({ modkey }, "A", oxwm.toggle_gaps())
183
184
-- Window manager controls
185
oxwm.key.bind({ modkey, "Shift" }, "Q", oxwm.quit())
186
oxwm.key.bind({ modkey, "Shift" }, "R", oxwm.restart())
187
188
-- Focus movement [1 for up in the stack, -1 for down]
189
oxwm.key.bind({ modkey }, "J", oxwm.client.focus_stack(1))
190
oxwm.key.bind({ modkey }, "K", oxwm.client.focus_stack(-1))
191
192
-- Window movement (swap position in stack)
193
oxwm.key.bind({ modkey, "Shift" }, "J", oxwm.client.move_stack(1))
194
oxwm.key.bind({ modkey, "Shift" }, "K", oxwm.client.move_stack(-1))
195
196
-- Multi-monitor support
197
198
-- Focus next/previous Monitors
199
oxwm.key.bind({ modkey }, "Comma", oxwm.monitor.focus(-1))
200
oxwm.key.bind({ modkey }, "Period", oxwm.monitor.focus(1))
201
-- Move window to next/previous Monitors
202
oxwm.key.bind({ modkey, "Shift" }, "Comma", oxwm.monitor.tag(-1))
203
oxwm.key.bind({ modkey, "Shift" }, "Period", oxwm.monitor.tag(1))
204
205
-- Workspace (tag) navigation
206
-- Switch to workspace N (tags are 0-indexed, so tag "1" is index 0)
207
oxwm.key.bind({ modkey }, "1", oxwm.tag.view(0))
208
oxwm.key.bind({ modkey }, "2", oxwm.tag.view(1))
209
oxwm.key.bind({ modkey }, "3", oxwm.tag.view(2))
210
oxwm.key.bind({ modkey }, "4", oxwm.tag.view(3))
211
oxwm.key.bind({ modkey }, "5", oxwm.tag.view(4))
212
oxwm.key.bind({ modkey }, "6", oxwm.tag.view(5))
213
oxwm.key.bind({ modkey }, "7", oxwm.tag.view(6))
214
oxwm.key.bind({ modkey }, "8", oxwm.tag.view(7))
215
oxwm.key.bind({ modkey }, "9", oxwm.tag.view(8))
216
217
-- Move focused window to workspace N
218
oxwm.key.bind({ modkey, "Shift" }, "1", oxwm.tag.move_to(0))
219
oxwm.key.bind({ modkey, "Shift" }, "2", oxwm.tag.move_to(1))
220
oxwm.key.bind({ modkey, "Shift" }, "3", oxwm.tag.move_to(2))
221
oxwm.key.bind({ modkey, "Shift" }, "4", oxwm.tag.move_to(3))
222
oxwm.key.bind({ modkey, "Shift" }, "5", oxwm.tag.move_to(4))
223
oxwm.key.bind({ modkey, "Shift" }, "6", oxwm.tag.move_to(5))
224
oxwm.key.bind({ modkey, "Shift" }, "7", oxwm.tag.move_to(6))
225
oxwm.key.bind({ modkey, "Shift" }, "8", oxwm.tag.move_to(7))
226
oxwm.key.bind({ modkey, "Shift" }, "9", oxwm.tag.move_to(8))
227
228
-- Combo view (view multiple tags at once) {argos_nothing}
229
-- Example: Mod+Ctrl+2 while on tag 1 will show BOTH tags 1 and 2
230
oxwm.key.bind({ modkey, "Control" }, "1", oxwm.tag.toggleview(0))
231
oxwm.key.bind({ modkey, "Control" }, "2", oxwm.tag.toggleview(1))
232
oxwm.key.bind({ modkey, "Control" }, "3", oxwm.tag.toggleview(2))
233
oxwm.key.bind({ modkey, "Control" }, "4", oxwm.tag.toggleview(3))
234
oxwm.key.bind({ modkey, "Control" }, "5", oxwm.tag.toggleview(4))
235
oxwm.key.bind({ modkey, "Control" }, "6", oxwm.tag.toggleview(5))
236
oxwm.key.bind({ modkey, "Control" }, "7", oxwm.tag.toggleview(6))
237
oxwm.key.bind({ modkey, "Control" }, "8", oxwm.tag.toggleview(7))
238
oxwm.key.bind({ modkey, "Control" }, "9", oxwm.tag.toggleview(8))
239
240
-- Multi tag (window on multiple tags)
241
-- Example: Mod+Ctrl+Shift+2 puts focused window on BOTH current tag and tag 2
242
oxwm.key.bind({ modkey, "Control", "Shift" }, "1", oxwm.tag.toggletag(0))
243
oxwm.key.bind({ modkey, "Control", "Shift" }, "2", oxwm.tag.toggletag(1))
244
oxwm.key.bind({ modkey, "Control", "Shift" }, "3", oxwm.tag.toggletag(2))
245
oxwm.key.bind({ modkey, "Control", "Shift" }, "4", oxwm.tag.toggletag(3))
246
oxwm.key.bind({ modkey, "Control", "Shift" }, "5", oxwm.tag.toggletag(4))
247
oxwm.key.bind({ modkey, "Control", "Shift" }, "6", oxwm.tag.toggletag(5))
248
oxwm.key.bind({ modkey, "Control", "Shift" }, "7", oxwm.tag.toggletag(6))
249
oxwm.key.bind({ modkey, "Control", "Shift" }, "8", oxwm.tag.toggletag(7))
250
oxwm.key.bind({ modkey, "Control", "Shift" }, "9", oxwm.tag.toggletag(8))
251
252
-------------------------------------------------------------------------------
253
-- Advanced: Keychords
254
-------------------------------------------------------------------------------
255
-- Keychords allow you to bind multiple-key sequences (like Emacs or Vim)
256
-- Format: {{modifiers}, key1}, {{modifiers}, key2}, ...
257
-- Example: Press Mod4+Space, then release and press T to spawn a terminal
258
oxwm.key.chord({
259
    { { modkey }, "Space" },
260
    { {},         "T" }
261
}, oxwm.spawn_terminal())
262
263
oxwm.key.chord({
264
    { { modkey }, "F" },
265
    { {},         "B" }
266
}, oxwm.spawn({ "sh", "-c", "$HOME/repos/dmenu-scripts/bookmarks-dmenu.sh" }))
267
268
oxwm.key.chord({
269
    { { modkey }, "F" },
270
    { {},         "F" }
271
}, oxwm.spawn({ "sh", "-c", "$HOME/repos/dmenu-scripts/repos-dmenu.sh" }))
272
273
oxwm.key.chord({
274
    { { modkey }, "F" },
275
    { {},         "O" }
276
}, oxwm.spawn({ "sh", "-c", "$HOME/repos/dmenu-scripts/tmux-dmenu.sh" }))
277
278
-------------------------------------------------------------------------------
279
-- Autostart
280
-------------------------------------------------------------------------------
281
-- Commands to run once when OXWM starts
282
-- Uncomment and modify these examples, or add your own
283
284
-- oxwm.autostart("picom")
285
-- oxwm.autostart("xwallpaper --zoom ~/walls/dune.jpg")
286
-- oxwm.autostart("dunst")
287
-- oxwm.autostart("nm-applet")