tony / oxwm

Branch: 20090b1
Switch branches/tags
master
tonybtw Added proper error handling in blocks, and font. added error modal so config syntax error doesnt crash when you reload your oxwm, added keybind overlay modal to show the important keybinds (inspired by niri), moved keysms helper function into const file to reduce code duplication. ad06fa5 2025-11-09
180 lines · 6.6 KB Raw Blame History
1 -- OXWM Configuration File (Lua)
2 -- Migrated from config.ron
3 -- Edit this file and reload with Mod+Shift+R (no compilation needed!)
4
5 local terminal = "st"
6 local modkey = "Mod4"
7
8 -- Color palette
9 local colors = {
10 lavender = "#a9b1d6",
11 light_blue = "#7aa2f7",
12 grey = "#bbbbbb",
13 purple = "#ad8ee6",
14 cyan = "#0db9d7",
15 bg = "#1a1b26",
16 green = "#9ece6a",
17 red = "#f7768e",
18 fg = "#bbbbbb",
19 blue = "#6dade3",
20 }
21
22 -- Main configuration table
23 return {
24 -- Appearance
25 border_width = 2,
26 border_focused = colors.blue,
27 border_unfocused = colors.grey,
28 font = "JetBrainsMono Nerd Font:style=Bold:size=12",
29
30 -- Window gaps
31 gaps_enabled = true,
32 gap_inner_horizontal = 5,
33 gap_inner_vertical = 5,
34 gap_outer_horizontal = 5,
35 gap_outer_vertical = 5,
36
37 -- Basics
38 modkey = "Mod1",
39 terminal = "st",
40
41 -- Workspace tags
42 tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9" },
43
44 -- Layout symbol overrides
45 layout_symbols = {
46 { name = "tiling", symbol = "[T]" },
47 { name = "normie", symbol = "[F]" },
48 },
49
50 -- Keybindings
51 keybindings = {
52 {
53 keys = {
54 { modifiers = { "Mod1" }, key = "Space" },
55 { modifiers = { }, key = "T" },
56 },
57 action = "Spawn",
58 arg = "st"
59 },
60 { modifiers = { "Mod1" }, key = "Return", action = "Spawn", arg = "st" },
61 { modifiers = { "Mod1" }, key = "D", action = "Spawn", arg = { "sh", "-c", "dmenu_run -l 10" } },
62 { modifiers = { "Mod1" }, key = "S", action = "Spawn", arg = { "sh", "-c", "maim -s | xclip -selection clipboard -t image/png" } },
63 { modifiers = { "Mod1" }, key = "Q", action = "KillClient" },
64 { modifiers = { "Mod1", "Shift" }, key = "Slash", action = "ShowKeybindOverlay" },
65 { modifiers = { "Mod1", "Shift" }, key = "F", action = "ToggleFullScreen" },
66 { modifiers = { "Mod1", "Shift" }, key = "Space", action = "ToggleFloating" },
67 { modifiers = { "Mod1" }, key = "F", action = "ChangeLayout", arg = "normie" },
68 { modifiers = { "Mod1" }, key = "C", action = "ChangeLayout", arg = "tiling" },
69 { modifiers = { "Mod1" }, key = "N", action = "CycleLayout" },
70 { modifiers = { "Mod1" }, key = "A", action = "ToggleGaps" },
71 { modifiers = { "Mod1", "Shift" }, key = "Q", action = "Quit" },
72 { modifiers = { "Mod1", "Shift" }, key = "R", action = "Restart" },
73 { modifiers = { "Mod1" }, key = "H", action = "FocusDirection", arg = 2 },
74 { modifiers = { "Mod1" }, key = "J", action = "FocusDirection", arg = 1 },
75 { modifiers = { "Mod1" }, key = "K", action = "FocusDirection", arg = 0 },
76 { modifiers = { "Mod1" }, key = "L", action = "FocusDirection", arg = 3 },
77 { modifiers = { "Mod1", "Shift" }, key = "H", action = "SwapDirection", arg = 2 },
78 { modifiers = { "Mod1", "Shift" }, key = "J", action = "SwapDirection", arg = 1 },
79 { modifiers = { "Mod1", "Shift" }, key = "K", action = "SwapDirection", arg = 0 },
80 { modifiers = { "Mod1", "Shift" }, key = "L", action = "SwapDirection", arg = 3 },
81 { modifiers = { "Mod1" }, key = "1", action = "ViewTag", arg = 0 },
82 { modifiers = { "Mod1" }, key = "2", action = "ViewTag", arg = 1 },
83 { modifiers = { "Mod1" }, key = "3", action = "ViewTag", arg = 2 },
84 { modifiers = { "Mod1" }, key = "4", action = "ViewTag", arg = 3 },
85 { modifiers = { "Mod1" }, key = "5", action = "ViewTag", arg = 4 },
86 { modifiers = { "Mod1" }, key = "6", action = "ViewTag", arg = 5 },
87 { modifiers = { "Mod1" }, key = "7", action = "ViewTag", arg = 6 },
88 { modifiers = { "Mod1" }, key = "8", action = "ViewTag", arg = 7 },
89 { modifiers = { "Mod1" }, key = "9", action = "ViewTag", arg = 8 },
90 { modifiers = { "Mod1", "Shift" }, key = "1", action = "MoveToTag", arg = 0 },
91 { modifiers = { "Mod1", "Shift" }, key = "2", action = "MoveToTag", arg = 1 },
92 { modifiers = { "Mod1", "Shift" }, key = "3", action = "MoveToTag", arg = 2 },
93 { modifiers = { "Mod1", "Shift" }, key = "4", action = "MoveToTag", arg = 3 },
94 { modifiers = { "Mod1", "Shift" }, key = "5", action = "MoveToTag", arg = 4 },
95 { modifiers = { "Mod1", "Shift" }, key = "6", action = "MoveToTag", arg = 5 },
96 { modifiers = { "Mod1", "Shift" }, key = "7", action = "MoveToTag", arg = 6 },
97 { modifiers = { "Mod1", "Shift" }, key = "8", action = "MoveToTag", arg = 7 },
98 { modifiers = { "Mod1", "Shift" }, key = "9", action = "MoveToTag", arg = 8 },
99 },
100
101 -- Status bar blocks
102 status_blocks = {
103 {
104 format = "",
105 command = "Battery",
106 battery_formats = {
107 charging = "󰂄 Bat: {}%",
108 discharging = "󰁹 Bat:{}%",
109 full = "󰁹 Bat: {}%"
110 },
111 interval_secs = 30,
112 color = colors.green,
113 underline = true
114 },
115 {
116 format = " │ ",
117 command = "Static",
118 interval_secs = 999999999,
119 color = colors.lavender,
120 underline = false
121 },
122 {
123 format = "󰍛 {used}/{total} GB",
124 command = "Ram",
125 interval_secs = 5,
126 color = colors.light_blue,
127 underline = true
128 },
129 {
130 format = " │ ",
131 command = "Static",
132 interval_secs = 999999999,
133 color = colors.lavender,
134 underline = false
135 },
136 {
137 format = " {}",
138 command = "Shell",
139 command_arg = "uname -r",
140 interval_secs = 999999999,
141 color = colors.red,
142 underline = true
143 },
144 {
145 format = " │ ",
146 command = "Static",
147 interval_secs = 999999999,
148 color = colors.lavender,
149 underline = false
150 },
151 {
152 format = "󰸘 {}",
153 command = "DateTime",
154 command_arg = "%a, %b %d - %-I:%M %P",
155 interval_secs = 1,
156 color = colors.cyan,
157 underline = true
158 },
159 },
160
161 -- Color schemes for bar
162 scheme_normal = {
163 foreground = colors.fg,
164 background = colors.bg,
165 underline = "#444444"
166 },
167 scheme_occupied = {
168 foreground = colors.cyan,
169 background = colors.bg,
170 underline = colors.cyan
171 },
172 scheme_selected = {
173 foreground = colors.cyan,
174 background = colors.bg,
175 underline = colors.purple
176 },
177
178 -- Autostart commands
179 autostart = {},
180 }