LGUG2Z / komorebi-application-specific-configuration

A central place to document all tweaks required for Komorebi to 'just work' with as many applications as possible
MIT License
69 stars 53 forks source link

Add few hints for manual setup #104

Closed rwijtvliet closed 3 weeks ago

rwijtvliet commented 2 months ago

For some reason, my organisation does not allow some traffic and the komorebic fetch-asc command ends in a timeout. I can still manually download the applications.yaml file from github, but I don't know what to do with it.

In the docs, it says: "The output of this command will also provide a line that you can paste into komorebi.json to ensure that the window manager looks for the file in the correction location."

But that doesn't help me, if the command won't complete successfully.

LGUG2Z commented 2 months ago

In the example configuration there is a pre-populated entry for app_specific_configuration_path - you can update this to wherever you want to put the manually downloaded file, but most people usually keep it in the same directory as their komorebi.json file, which is where the fetch-asc command will download it to as well.

You can find more details on any of the configuration options on the configuration reference page which exposes a full JSON schema (which can also be used to power autocompletions in editors which support it).

rwijtvliet commented 1 month ago

Thanks for your fast reply.

Concerning documentation - the configuration reference does not specify the format of the applications.json file, correct? Is this described somewhere?

I'm trying to get Teams to tile, but it won't, and I'm not sure if my applications.json file (a) is loaded and (b) has correct syntax.

bedge commented 1 month ago

Concerning documentation - the configuration reference does not specify the format of the applications.json file, correct? Is this described somewhere?

I was wondering the same thing. For us noobs, a page or so of text describing the options and matching techniques would be super useful. It's hard to glean an understanding of the mechanism be looking at the application cfg list and the schema. Something like

Sort of the "threshold concept" thing here with a lot of komorebi. Those working on it have forgotten what they didn't know when they started :) I am 100% guilty of the same thing, so I know it when I see it from the other side.

LGUG2Z commented 1 month ago

I'll work on some docs for this as we switch from YAML to JSON for the next release, but the short version is that nobody should need to touch this file specifically unless I ask them to.

All personal configuration of applications should be done in the komorebi.json file and not in the applications.yaml|json file

bedge commented 1 month ago

Ok, works for me. I misinterpreted the statement in the readme:

A community-driven repository for users to share ...

as "please submit PRs for missing apps"

Thanks

bedge commented 1 month ago

Granted, the target (this repo) of my question was wrong, but the content regarding the content of the schema ones uses to define app-specific config is still relevant.

(Should schema related questions be posted here or in the main repo?)

Looking at the docs for adding custom app configs into komorebi.json, https://lgug2z.github.io/komorebi/common-workflows/tray-and-multi-window-applications.html references what appears to be the same schema/format:

{
  "tray_and_multi_window_applications": [
    {
      "kind": "Class",
      "id": "SDL_app",
      "matching_strategy": "Equals"
    }
  ]
}

For example, referencing the schema: https://raw.githubusercontent.com/LGUG2Z/komorebi/master/schema.asc.json, a matching rule shows:

    "MatchingRule": {
      "anyOf": [
        {
          "$ref": "#/definitions/IdWithIdentifier"

Are there any docs for what the "#/definitions/IdWithIdentifier" is?

What may be useful Is a utility where one can click on a window and dump the relevant metadata, to then insert select bits of it into a MatchingRule.

A bit more detail on how to populate tray_and_multi_window_applications ?

Apologies for being that annoying noob that doesn't even know what to ask, in the right place and format. I'm annoying myself already with the number of questions.

LGUG2Z commented 3 weeks ago

The README has been updated to actually have some guidance now 😅

The YAML format will be deprecated as of the next release and the JSON file will be used exclusively going forward.

RE: Looking up schema entities, with the new ASC JSON file (and the komorebi.json file), if you use an editor like VSCode with auto-completions built in you should be able to hit ctrl-space and it will traverse the schema file and find you both the keys and the docs that you need.

For the specific question about IdWithIdentifier, if you search the schema file you linked, you can find it defined as:

    "IdWithIdentifier": {
      "type": "object",
      "required": [
        "id",
        "kind"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/definitions/ApplicationIdentifier"
        },
        "matching_strategy": {
          "anyOf": [
            {
              "$ref": "#/definitions/MatchingStrategy"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },

... Which then sends you looking at ApplicationIdentifier and MatchingStrategy 😅

Best to just let an editor with autocompletion support do the work for you.