abenz1267 / walker

Application launcher similar to Rofi etc. . Wayland native.
MIT License
263 stars 12 forks source link

Improve documentation #40

Closed ItsDrike closed 1 month ago

ItsDrike commented 1 month ago

Currently, the walker project has basically no documentation other than what the readme shows. The example config file doesn't contain everything, and doesn't explain what the individual options do. It is necessary to explore the code itself to even just see the which options are available, and even there the project doesn't have any comments or anything to potentially make it simpler to understand these options. Even though for some, it may be relatively clear, that's not necessarily the case for each of these values.

The project could also use some docs to describe what each of the CSS classes do, considering the styling is done with a custom CSS file.

I'd especially love to see documentation on the external modules, as it's fairly confusing to use in my opinion. I know that you have this example in your readme, which I did get to work:

    {
      "name": "filesystem",
      "prefix": "~",
      "src": "fd --base-directory /home/itsdrike/ %TERM%",
      "cmd": "xdg-open file://%RESULT%",
      "transform": true
    }

But there's no explanation on what's the point of that transform key here, how does src and cmd work? I assume src command gets ran on any user input, and cmd gets ran on the picked choice from that list? With this assumption then, I tried implementing a small custom external module, like this:

    {
      "name": "test",
      "prefix": "!",
      "src": "echo '%TERM%'",
      "cmd": "notify-send 'test' '%RESULT%'",
      "transform": true
    }

However, no items appeared in the menu, I don't understand why, there weren't any messages about this in the logs either. I then tried this:

    {
      "name": "test",
      "prefix": "!",
      "src": "ls %TERM%",
      "cmd": "notify-send 'test' '%RESULT%'",
      "transform": true
    }

For which, when there wasn't any input, it did show the ls items of the directory I ran walker from, however, the moment I started typing anything, the log started showing: exit status 2. But why is that? Exit status 2 from ls, according to the man page, means: serious trouble (e.g., cannot access command-line argument). Not exactly helpful in knowing what exactly going on though.

I tried some other things, but ultimately, I just wasn't able to figure out how it's supposed to work. The project really needs to do a better job at describing what it can actually do, and how it should be configured.

Even just a few github wiki pages would be a massive improvement here

abenz1267 commented 1 month ago

I've added a wiki.

For styling: you'll find a list in the wiki... although I'm not sure where further explanation is needed. If something is unclear to anyone, they'd need to open an issue and ask. I can only guess so much. Something that's clear to me, might not be to others. Those are blind-spots that'll stay blind-spots until someone sheds a light on them.

For config: you'll find a complete json in the wiki. Where needed, i added comments. Some things are self-explanatory in my eyes, but what i said about the styling applies here as well obviously.

For the plugins/external modules:

The transform-option has just been killed by me, it didn't serve any purpose other than telling Walker to transform the output of a src into entries for Walker, which is always the case as soon as there's a cmd present. So transform is redundant anyways.

I've tested your echo/notify-send example and it worked just fine. I've fixed a little bad code that might have caused a bug... maybe it was related.

I mean: if you are trying something and it doesn't work => open an issue. It might be a bug, or user error. We can always figure it out.

ItsDrike commented 1 month ago

Thanks for adding the documentation, also, the echo custom module does work for me too now, so the bug seems to have been fixed.