tony / oxwm

chore(nix): format home-managerm module Browse files
emzywastaken committed 2026-02-18 parent 721f67a commit cf150e66e0854162fe40be948cd284dc8d64e2eb
Showing 1 changed file with 88 additions and 74 deletions. UnifiedSplit
+88 −74 hm.nix
@@ -12,7 +12,8 @@
12 12 common = ''
13 13 interval = ${toString block.interval},
14 14 color = "#${block.color}",
15 - underline = ${boolToString block.underline},'';
15 + underline = ${boolToString block.underline},
16 + '';
16 17 in
17 18 "oxwm.bar.block.${block.kind}({\n"
18 19 + (
@@ -133,18 +134,20 @@ in {
133 134 });
134 135 default = [];
135 136 description = "The list of keybinds";
136 - example = '' [
137 - {
138 - mods = [ "Mod4" "Shift" ];
139 - key = "Slash";
140 - action = "oxwm.show_keybinds()";
141 - }
142 - {
143 - mods = [ "Mod4" ];
144 - key = "D";
145 - action = "oxwm.spawn({ "sh", "-c", "dmenu_run -l 10" })";
146 - }
147 - ];'';
137 + example = ''
138 + [
139 + {
140 + mods = [ "Mod4" "Shift" ];
141 + key = "Slash";
142 + action = "oxwm.show_keybinds()";
143 + }
144 + {
145 + mods = [ "Mod4" ];
146 + key = "D";
147 + action = "oxwm.spawn({ "sh", "-c", "dmenu_run -l 10" })";
148 + }
149 + ];
150 + '';
148 151 };
149 152 chords = mkOption {
150 153 type = types.listOf (types.submodule {
@@ -165,21 +168,22 @@ in {
165 168 });
166 169 default = [];
167 170 description = "A list of key chords for OXWM to use";
168 - example = '' [
169 - {
170 - notes = [
171 - {
172 - mods = [ "Mod4" ];
173 - key = "Space";
174 - }
175 - {
176 - mods = [];
177 - key = "T";
178 - }
179 - ];
180 - action = "oxwm.spawn_terminal()";
181 - }
182 - ];
171 + example = ''
172 + [
173 + {
174 + notes = [
175 + {
176 + mods = [ "Mod4" ];
177 + key = "Space";
178 + }
179 + {
180 + mods = [];
181 + key = "T";
182 + }
183 + ];
184 + action = "oxwm.spawn_terminal()";
185 + }
186 + ];
183 187 '';
184 188 };
185 189 border = {
@@ -298,28 +302,30 @@ in {
298 302 };
299 303 });
300 304 description = "The modules to put on the bar";
301 - example = '' [
302 - {
303 - kind = "ram";
304 - interval = 5;
305 - format = "Ram: {used}/{total} GB";
306 - color = "9ece6a";
307 - }
308 - {
309 - kind = "static";
310 - text = "|";
311 - interval = 99999999;
312 - color = "6dade3";
313 - }
314 - {
315 - kind = "shell";
316 - format = "{}";
317 - command = "uname -r";
318 - interval = 9999999;
319 - color = "f7768e";
320 - underline = true;
321 - }
322 - ];'';
305 + example = ''
306 + [
307 + {
308 + kind = "ram";
309 + interval = 5;
310 + format = "Ram: {used}/{total} GB";
311 + color = "9ece6a";
312 + }
313 + {
314 + kind = "static";
315 + text = "|";
316 + interval = 99999999;
317 + color = "6dade3";
318 + }
319 + {
320 + kind = "shell";
321 + format = "{}";
322 + command = "uname -r";
323 + interval = 9999999;
324 + color = "f7768e";
325 + underline = true;
326 + }
327 + ];
328 + '';
323 329 };
324 330 };
325 331 rules = mkOption {
@@ -370,18 +376,20 @@ in {
370 376 };
371 377 });
372 378 description = "A list of window rules for the window manager to follow";
373 - example = '' [
374 - {
375 - match.class = "gimp";
376 - floating = true;
377 - }
378 - {
379 - match.class = "firefox";
380 - match.title = "Library";
381 - tag = 9;
382 - focus = true;
383 - }
384 - ];'';
379 + example = ''
380 + [
381 + {
382 + match.class = "gimp";
383 + floating = true;
384 + }
385 + {
386 + match.class = "firefox";
387 + match.title = "Library";
388 + tag = 9;
389 + focus = true;
390 + }
391 + ];
392 + '';
385 393 };
386 394 extraConfig = mkOption {
387 395 type = types.lines;
@@ -423,27 +431,33 @@ in {
423 431 oxwm.set_layout_symbol("normie", "${cfg.layoutSymbol.normie}")
424 432 oxwm.set_layout_symbol("tabbed", "${cfg.layoutSymbol.tabbed}")
425 433
426 - ${concatMapStrings (cmd: ''
434 + ${
435 + concatMapStrings (cmd: ''
427 436 oxwm.autostart("${cmd}")
428 437 '')
429 - cfg.autostart}
430 - ${concatMapStrings (bind: ''
438 + cfg.autostart
439 + }
440 + ${
441 + concatMapStrings (bind: ''
431 442 oxwm.key.bind({ ${concatMapStringsSep ", " (m: ''"${m}"'') bind.mods} }, "${bind.key}", ${bind.action})
432 443 '')
433 - cfg.binds}
434 - ${concatMapStrings (chord: ''
444 + cfg.binds
445 + }
446 + ${
447 + concatMapStrings (chord: ''
435 448 oxwm.key.chord({
436 - ${concatMapStringsSep ",\n " (
437 - note: ''{ { ${concatMapStringsSep ", " (m: ''"${m}"'') note.mods} }, "${note.key}" }''
438 - )
439 - chord.notes}
449 + ${concatMapStringsSep ",\n " (note: ''{ { ${concatMapStringsSep ", " (m: ''"${m}"'') note.mods} }, "${note.key}" }'') chord.notes}
440 450 }, ${chord.action})
441 451 '')
442 - cfg.chords}
443 - ${concatMapStrings (rule: ''
452 + cfg.chords
453 + }
454 + ${
455 + concatMapStrings (rule: ''
444 456 ${ruleToLua rule}
445 457 '')
446 - cfg.rules}
458 + cfg.rules
459 + }
460 +
447 461 ${cfg.extraConfig}
448 462 '';
449 463 };