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