tony / oxwm

Branch: 9817677
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
164 lines · 6.2 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 local secondary_modkey = "Mod1"
8
9 -- Color palette
10 local colors = {
11 fg = "#bbbbbb",
12 red = "#f7768e",
13 bg = "#1a1b26",
14 cyan = "#0db9d7",
15 green = "#9ece6a",
16 lavender = "#a9b1d6",
17 light_blue = "#7aa2f7",
18 grey = "#bbbbbb",
19 blue = "#6dade3",
20 purple = "#ad8ee6",
21 }
22
23 -- Main configuration table
24 return {
25 -- Appearance
26 border_width = 2,
27 border_focused = colors.blue,
28 border_unfocused = colors.grey,
29 font = "monospace:style=Bold:size=10",
30
31 -- Window gaps
32 gaps_enabled = true,
33 gap_inner_horizontal = 5,
34 gap_inner_vertical = 5,
35 gap_outer_horizontal = 5,
36 gap_outer_vertical = 5,
37
38 -- Basics
39 modkey = "Mod4",
40 terminal = "st",
41
42 -- Workspace tags
43 tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9" },
44
45 -- Layout symbol overrides
46 layout_symbols = {
47 { name = "tiling", symbol = "[T]" },
48 { name = "normie", symbol = "[F]" },
49 },
50
51 -- Keybindings
52 keybindings = {
53 { modifiers = { "Mod4" }, key = "Return", action = "Spawn", arg = "st" },
54 { modifiers = { "Mod4" }, key = "D", action = "Spawn", arg = { "sh", "-c", "dmenu_run -l 10" } },
55 { modifiers = { "Mod4" }, key = "S", action = "Spawn", arg = { "sh", "-c", "maim -s | xclip -selection clipboard -t image/png" } },
56 { modifiers = { "Mod4" }, key = "Q", action = "KillClient" },
57 { modifiers = { "Mod4", "Shift" }, key = "Slash", action = "ShowKeybindOverlay" },
58 { modifiers = { "Mod4", "Shift" }, key = "F", action = "ToggleFullScreen" },
59 { modifiers = { "Mod4", "Shift" }, key = "Space", action = "ToggleFloating" },
60 { modifiers = { "Mod4" }, key = "F", action = "ChangeLayout", arg = "normie" },
61 { modifiers = { "Mod4" }, key = "C", action = "ChangeLayout", arg = "tiling" },
62 { modifiers = { "Mod1" }, key = "N", action = "CycleLayout" },
63 { modifiers = { "Mod4" }, key = "A", action = "ToggleGaps" },
64 { modifiers = { "Mod4", "Shift" }, key = "Q", action = "Quit" },
65 { modifiers = { "Mod4", "Shift" }, key = "R", action = "Restart" },
66 { modifiers = { "Mod4" }, key = "H", action = "FocusDirection", arg = 2 },
67 { modifiers = { "Mod4" }, key = "J", action = "FocusDirection", arg = 1 },
68 { modifiers = { "Mod4" }, key = "K", action = "FocusDirection", arg = 0 },
69 { modifiers = { "Mod4" }, key = "L", action = "FocusDirection", arg = 3 },
70 { modifiers = { "Mod4" }, key = "Comma", action = "FocusMonitor", arg = -1 },
71 { modifiers = { "Mod4" }, key = "Period", action = "FocusMonitor", arg = 1 },
72 { modifiers = { "Mod4" }, key = "1", action = "ViewTag", arg = 0 },
73 { modifiers = { "Mod4" }, key = "2", action = "ViewTag", arg = 1 },
74 { modifiers = { "Mod4" }, key = "3", action = "ViewTag", arg = 2 },
75 { modifiers = { "Mod4" }, key = "4", action = "ViewTag", arg = 3 },
76 { modifiers = { "Mod4" }, key = "5", action = "ViewTag", arg = 4 },
77 { modifiers = { "Mod4" }, key = "6", action = "ViewTag", arg = 5 },
78 { modifiers = { "Mod4" }, key = "7", action = "ViewTag", arg = 6 },
79 { modifiers = { "Mod4" }, key = "8", action = "ViewTag", arg = 7 },
80 { modifiers = { "Mod4" }, key = "9", action = "ViewTag", arg = 8 },
81 { modifiers = { "Mod4", "Shift" }, key = "1", action = "MoveToTag", arg = 0 },
82 { modifiers = { "Mod4", "Shift" }, key = "2", action = "MoveToTag", arg = 1 },
83 { modifiers = { "Mod4", "Shift" }, key = "3", action = "MoveToTag", arg = 2 },
84 { modifiers = { "Mod4", "Shift" }, key = "4", action = "MoveToTag", arg = 3 },
85 { modifiers = { "Mod4", "Shift" }, key = "5", action = "MoveToTag", arg = 4 },
86 { modifiers = { "Mod4", "Shift" }, key = "6", action = "MoveToTag", arg = 5 },
87 { modifiers = { "Mod4", "Shift" }, key = "7", action = "MoveToTag", arg = 6 },
88 { modifiers = { "Mod4", "Shift" }, key = "8", action = "MoveToTag", arg = 7 },
89 { modifiers = { "Mod4", "Shift" }, key = "9", action = "MoveToTag", arg = 8 },
90 { modifiers = { "Mod4", "Shift" }, key = "H", action = "SwapDirection", arg = 2 },
91 { modifiers = { "Mod4", "Shift" }, key = "J", action = "SwapDirection", arg = 1 },
92 { modifiers = { "Mod4", "Shift" }, key = "K", action = "SwapDirection", arg = 0 },
93 { modifiers = { "Mod4", "Shift" }, key = "L", action = "SwapDirection", arg = 3 },
94 {
95 keys = {
96 { modifiers = { "Mod4" }, key = "Space" },
97 { modifiers = { }, key = "T" },
98 },
99 action = "Spawn",
100 arg = "st"
101 },
102 },
103
104 -- Status bar blocks
105 status_blocks = {
106 {
107 format = "Ram: {used}/{total} GB",
108 command = "Ram",
109 interval_secs = 5,
110 color = colors.light_blue,
111 underline = true
112 },
113 {
114 format = " │ ",
115 command = "Static",
116 interval_secs = 999999999,
117 color = colors.lavender,
118 underline = false
119 },
120 {
121 format = "Kernel: {}",
122 command = "Shell",
123 command_arg = "uname -r",
124 interval_secs = 999999999,
125 color = colors.red,
126 underline = true
127 },
128 {
129 format = " │ ",
130 command = "Static",
131 interval_secs = 999999999,
132 color = colors.lavender,
133 underline = false
134 },
135 {
136 format = "{}",
137 command = "DateTime",
138 command_arg = "%a, %b %d - %-I:%M %P",
139 interval_secs = 1,
140 color = colors.cyan,
141 underline = true
142 },
143 },
144
145 -- Color schemes for bar
146 scheme_normal = {
147 foreground = colors.fg,
148 background = colors.bg,
149 underline = "#444444"
150 },
151 scheme_occupied = {
152 foreground = colors.cyan,
153 background = colors.bg,
154 underline = colors.cyan
155 },
156 scheme_selected = {
157 foreground = colors.cyan,
158 background = colors.bg,
159 underline = colors.purple
160 },
161
162 -- Autostart commands
163 autostart = { },
164 }