Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Komorobi is unable to load the static config #634

Closed
claudio4 opened this issue Jan 12, 2024 · 11 comments
Closed

[BUG]: Komorobi is unable to load the static config #634

claudio4 opened this issue Jan 12, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@claudio4
Copy link

Describe the bug
Komorobi refuses to load the static config file.
If komorebi is run without arguments it just ignores the config file, as if it does not exists. If I use the --config flag to force it to load the config file I get this error:

2024-01-12T21:35:32.715591Z  INFO komorebi: creating window manager from static configuration file: C:\Users\claudio4\AppData\Roaming\komorebi\komorebi.json
Error:
   0: The system cannot find the file specified. (os error 2)

Location:
   komorebi\src\static_config.rs:625

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: BaseThreadInitThunk<unknown>
      at <unknown source file>:<unknown line>
   2: RtlUserThreadStart<unknown>
      at <unknown source file>:<unknown line>

I AM sure that the file does indeed exists as I can cat it just fine.

To Reproduce
Steps to reproduce the behavior:

  1. Install Komorobi, either via winget or MSI. I have not tried scoop.
  2. (Optional) Set up a KOMOREBI_CONFIG_HOME.
  3. Start komorobi using komorebi --config "PATH\TO\komorebi.json" alternatvely using komorebic start --config "PATH\TO\komorebi.json" has the same effect, but it obscures the error message.
  4. See it crash.

Expected behavior
Komorobi should read the config file.

Operating System

OS Name:                   Microsoft Windows 11 Enterprise
OS Version:                10.0.22621 N/A Build 22621

komorebic check Output

KOMOREBI_CONFIG_HOME detected: C:\Users\claudio4\AppData\Roaming\komorebi

Looking for configuration files in C:\Users\claudio4\AppData\Roaming\komorebi

No komorebi configuration found in C:\Users\claudio4\AppData\Roaming\komorebi

If running 'komorebic start --await-configuration', you will manually have to call the following command to begin tiling: komorebic complete-configuration

Additional context
This happens with or without whkd or ahk installed. I have sucessfully replicated in a brand new Windows Sandbox (a.k.a a VM with my same version of Windows).
Probably related to #625, but that issue also talks about whkd, while this one is standalone to komorebi.

@claudio4 claudio4 added the bug Something isn't working label Jan 12, 2024
@azinsharaf
Copy link
Sponsor

i agree that returning No komorebi configuration found in ... message is an issue. but beside that if you force to use it in -c it should pick it up.
i run it this way and it works:
komorebic start -c "$Env:USERPROFILE\.config\komorebi\komorebi.json" --whkd

as a side note, storing it in .config makes the dot files management easier. it is just a matter of personal preference.

@claudio4
Copy link
Author

i agree that returning No komorebi configuration found in ... message is an issue. but beside that if you force to use it in -c it should pick it up.

It should but it does not.

i run it this way and it works:
komorebic start -c "$Env:USERPROFILE.config\komorebi\komorebi.json" --whkd

For me it produces this error:

~ ❯ komorebic start -c "$Env:USERPROFILE\.config\komorebi\komorebi.json"                                       13:31:36
Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\claudio4\.config\komorebi\komorebi.json"' -WindowStyle hidden
Waiting for komorebi.exe to start...komorebi.exe did not start... Trying again
Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\claudio4\.config\komorebi\komorebi.json"' -WindowStyle hidden

Before runnig the command above I have moved my komorebi folder to .config to prove that it is not some appdata werideness.

@azinsharaf
Copy link
Sponsor

can you post your json file?

@claudio4
Copy link
Author

Yes, ofcourse,

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/master/schema.json",
  "app_specific_configuration_path": "C:\\Users\\claudio4\\AppData\\Roaming\\komorebi\\applications.yaml",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "alt_focus_hack": true,
  "default_workspace_padding": 0,
  "default_container_padding": 0,
  "active_window_border": true,
  "active_window_border_colours": {
    "single": { "r": 66, "g": 165, "b": 245 },
    "stack": { "r": 256, "g": 165, "b": 66 },
    "monocle": { "r": 255, "g": 51, "b": 153 }
  },
  "monitors": [
    {
      "workspaces": [
        { "name": "I", "layout": "BSP" },
        { "name": "II", "layout": "VerticalStack" },
        { "name": "III", "layout": "HorizontalStack" },
        { "name": "IV", "layout": "UltrawideVerticalStack" },
        { "name": "V", "layout": "Rows" }
      ]
    }
  ]
}

@azinsharaf
Copy link
Sponsor

the syntax and schema look correct. Do you have applications.yaml in the provided path?

@LGUG2Z
Copy link
Owner

LGUG2Z commented Jan 13, 2024

You need to use forward slashes in paths in the JSON files ^

@claudio4
Copy link
Author

the syntax and schema look correct. Do you have applications.yaml in the provided path?

I was about to say yes, then double checked and... No 🤦. For whatever the reason (probably me being very dumb) my file was called applications.yml instead of applications.yaml. So yeah, that one is on me. I'm very sorry.

Nonetheless, I think that improving the error message for a missing applications.yaml could be a wise move to prevent more people f*nking up like I did.

@azinsharaf
Copy link
Sponsor

glad it works.
i agree that the messages contents can be improved.

@LGUG2Z
Copy link
Owner

LGUG2Z commented Jan 14, 2024

❯ komorebic check
KOMOREBI_CONFIG_HOME detected: C:\Users\LGUG2Z\.config\komorebi

Looking for configuration files in C:\Users\LGUG2Z\.config\komorebi

Found komorebi.json; this file can be passed to the start command with the --config flag

Application specific configuration file path 'C:/Users/LGUG2Z/.config/komorebi/applications.yml' does not exist. Try running 'komorebic fetch-asc'

Found ~/.config/whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag

I have updated the komorebic check command to validate the existence of the file - this will be part of the next release.

@LGUG2Z LGUG2Z closed this as completed Jan 14, 2024
@goyalyashpal
Copy link

Probably related to #625, but that issue also talks about whkd, while this one is standalone to komorebi.

hehe, i had no plan to use whkd, i faced that issue without whkd first, but as it's said that komorebi requires external thing to manage input etc, and it didn't seem working either. that's why i installed whkd as a fallback - "oh, i guess it requires that too to work"

@goyalyashpal
Copy link

this will be part of the next release.

it was this one right?

https://github.com/LGUG2Z/komorebi/releases/tag/v0.1.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants