[FEAT]: Static configuration loading #207

Closed
opened 2026-01-05 14:49:00 +01:00 by adam · 5 comments
Owner

Originally created by @LGUG2Z on GitHub (May 12, 2023).

Originally assigned to: @LGUG2Z on GitHub.

Is your feature request related to a problem? Please describe.
Not necessarily a problem for me, but I see many users express a preference for other tiling window managers that allow the loading of static configuration from YAML/TOML/etc files. Allowing similar static configuration loading could reduce friction for users who are not confident using PowerShell or AHK to configure komorebi.

Describe the solution you'd like
Expose a flag and/or an environment variable which points to a static configuration file that can be loaded at startup. Ideally, this would also allow users to consume a reference to an applications.yaml (ie. allowing them to pin to a specific revision) for app-specific fixes.

A JSONSchema file should also be published so that users can benefit from autocompletions when editing this static configuration file.

Describe alternatives you've considered
Improve education on runtime configuration, though I don't think this will really change the minds of people who are dead set on using static configuration files.

Originally created by @LGUG2Z on GitHub (May 12, 2023). Originally assigned to: @LGUG2Z on GitHub. **Is your feature request related to a problem? Please describe.** Not necessarily a problem for me, but I see many users express a preference for other tiling window managers that allow the loading of static configuration from YAML/TOML/etc files. Allowing similar static configuration loading could reduce friction for users who are not confident using PowerShell or AHK to configure `komorebi`. **Describe the solution you'd like** Expose a flag and/or an environment variable which points to a static configuration file that can be loaded at startup. Ideally, this would also allow users to consume a reference to an `applications.yaml` (ie. allowing them to pin to a specific revision) for app-specific fixes. A JSONSchema file should also be published so that users can benefit from autocompletions when editing this static configuration file. **Describe alternatives you've considered** Improve education on runtime configuration, though I don't think this will really change the minds of people who are dead set on using static configuration files.
adam added the enhancement label 2026-01-05 14:49:00 +01:00
adam closed this issue 2026-01-05 14:49:00 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Jun 16, 2023):

Video on the development of this feature and how to use it while it's still being worked on: https://www.youtube.com/watch?v=ucQ1eBdAZqU

@LGUG2Z commented on GitHub (Jun 16, 2023): Video on the development of this feature and how to use it while it's still being worked on: https://www.youtube.com/watch?v=ucQ1eBdAZqU
Author
Owner

@LGUG2Z commented on GitHub (Jun 17, 2023):

On the feature/static-config branch you can now start whkd directly from the komorebic start so you end up with...

# ❯ komorebic start -c C:\Users\LGUG2Z\komorebi.json --whkd
Start-Process 'komorebi.exe' -ArgumentList '--config=C:\Users\LGUG2Z\komorebi.json' -WindowStyle hidden
# Waiting for komorebi.exe to start...Started!

if (!(Get-Process whkd -ErrorAction SilentlyContinue))
{
  Start-Process whkd -WindowStyle hidden
}

This means you don't need a komorebi.ps1 or komorebi.ahk file at all anymore if you don't want to use one

You can also use this JSON Schema to autocomplete (with documentation!) your komorebi.json static configuration files: https://raw.githubusercontent.com/LGUG2Z/komorebi/fb737366af28c1ccafed1b9e9af2a980eca192e6/schema.json

I'll be looking at updating the quickstart guide and readme soon to reflect these changes, and I think this is the last thing that needs to be done before merging this into the master branch!

@LGUG2Z commented on GitHub (Jun 17, 2023): On the feature/static-config branch you can now start whkd directly from the komorebic start so you end up with... ```pwsh # ❯ komorebic start -c C:\Users\LGUG2Z\komorebi.json --whkd Start-Process 'komorebi.exe' -ArgumentList '--config=C:\Users\LGUG2Z\komorebi.json' -WindowStyle hidden # Waiting for komorebi.exe to start...Started! if (!(Get-Process whkd -ErrorAction SilentlyContinue)) { Start-Process whkd -WindowStyle hidden } ``` This means you don't need a `komorebi.ps1` or `komorebi.ahk` file at all anymore if you don't want to use one You can also use this JSON Schema to autocomplete (with documentation!) your `komorebi.json` static configuration files: https://raw.githubusercontent.com/LGUG2Z/komorebi/fb737366af28c1ccafed1b9e9af2a980eca192e6/schema.json I'll be looking at updating the quickstart guide and readme soon to reflect these changes, and I think this is the last thing that needs to be done before merging this into the `master` branch!
Author
Owner

@LGUG2Z commented on GitHub (Jun 21, 2023):

The latest version of this branch now also automatically watches the komorebi.json file for changes and applies them. 👌

@LGUG2Z commented on GitHub (Jun 21, 2023): The latest version of this branch now also automatically watches the `komorebi.json` file for changes and applies them. 👌
Author
Owner

@LGUG2Z commented on GitHub (Jun 23, 2023):

The latest version of this branch includes a new command, komorebic generate-static-config, which dumps the current config state of komorebi to a JSON object in the terminal:

https://www.youtube.com/watch?v=2PK1ie-R1Z8

// ❯ komorebic generate-static-config
{
  "resize_delta": 50,
  "window_container_behaviour": "Create",
  "cross_monitor_move_behaviour": "Insert",
  "unmanaged_window_operation_behaviour": "Op",
  "mouse_follows_focus": true,
  "border_width": 20,
  "active_window_border": true,
  "default_workspace_padding": 10,
  "default_container_padding": 20,
  "monitors": [
    {
      "workspaces": [
        {
          "name": "personal",
          "layout": "UltrawideVerticalStack",
          "layout_rules": {
            "0": "UltrawideVerticalStack"
          },
          "initial_workspace_rules": [
            {
              "kind": "Exe",
              "id": "firefox.exe"
            }
          ]
        },
        {
          "name": "work",
          "layout": "BSP",
          "layout_rules": {},
          "initial_workspace_rules": [
            {
              "kind": "Exe",
              "id": "chrome.exe"
            }
          ]
        },
        {
          "name": "music",
          "layout": "BSP",
          "layout_rules": {},
          "initial_workspace_rules": [
            {
              "kind": "Exe",
              "id": "Plexamp.exe"
            },
            {
              "kind": "Exe",
              "id": "Spotify.exe"
            }
          ]
        }
      ]
    },
    {
      "workspaces": [
        {
          "name": "chat",
          "layout": "Rows",
          "layout_rules": {},
          "workspace_padding": 20,
          "initial_workspace_rules": [
            {
              "kind": "Exe",
              "id": "Beeper.exe"
            },
            {
              "kind": "Exe",
              "id": "Discord.exe"
            },
            {
              "kind": "Exe",
              "id": "Slack.exe"
            }
          ]
        }
      ]
    }
  ],
  "alt_focus_hack": true,
  "window_hiding_behaviour": "Cloak"
}
@LGUG2Z commented on GitHub (Jun 23, 2023): The latest version of this branch includes a new command, `komorebic generate-static-config`, which dumps the current config state of `komorebi` to a JSON object in the terminal: https://www.youtube.com/watch?v=2PK1ie-R1Z8 ```json5 // ❯ komorebic generate-static-config { "resize_delta": 50, "window_container_behaviour": "Create", "cross_monitor_move_behaviour": "Insert", "unmanaged_window_operation_behaviour": "Op", "mouse_follows_focus": true, "border_width": 20, "active_window_border": true, "default_workspace_padding": 10, "default_container_padding": 20, "monitors": [ { "workspaces": [ { "name": "personal", "layout": "UltrawideVerticalStack", "layout_rules": { "0": "UltrawideVerticalStack" }, "initial_workspace_rules": [ { "kind": "Exe", "id": "firefox.exe" } ] }, { "name": "work", "layout": "BSP", "layout_rules": {}, "initial_workspace_rules": [ { "kind": "Exe", "id": "chrome.exe" } ] }, { "name": "music", "layout": "BSP", "layout_rules": {}, "initial_workspace_rules": [ { "kind": "Exe", "id": "Plexamp.exe" }, { "kind": "Exe", "id": "Spotify.exe" } ] } ] }, { "workspaces": [ { "name": "chat", "layout": "Rows", "layout_rules": {}, "workspace_padding": 20, "initial_workspace_rules": [ { "kind": "Exe", "id": "Beeper.exe" }, { "kind": "Exe", "id": "Discord.exe" }, { "kind": "Exe", "id": "Slack.exe" } ] } ] } ], "alt_focus_hack": true, "window_hiding_behaviour": "Cloak" } ```
Author
Owner

@LGUG2Z commented on GitHub (Jun 26, 2023):

The latest version of this branch includes a new command, komorebic fetch-asc which will update applications.yaml to the latest version in the user's config directory:

❯ komorebic fetch-asc
Latest version of applications.yaml from https://github.com/LGUG2Z/komorebi-application-specific-configuration downloaded

You can add this to your komorebi.json static configuration file like this:

"app_specific_configuration_path": "C:/Users/LGUG2Z/.config/komorebi/applications.yaml"

https://www.youtube.com/watch?v=STlES_16q3o

@LGUG2Z commented on GitHub (Jun 26, 2023): The latest version of this branch includes a new command, `komorebic fetch-asc` which will update `applications.yaml` to the latest version in the user's config directory: ``` ❯ komorebic fetch-asc Latest version of applications.yaml from https://github.com/LGUG2Z/komorebi-application-specific-configuration downloaded You can add this to your komorebi.json static configuration file like this: "app_specific_configuration_path": "C:/Users/LGUG2Z/.config/komorebi/applications.yaml" ``` https://www.youtube.com/watch?v=STlES_16q3o
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#207