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

Feature Req: Schema/Linting standard for hyprland config #2843

Closed
DaveWK opened this issue Jul 29, 2023 · 10 comments
Closed

Feature Req: Schema/Linting standard for hyprland config #2843

DaveWK opened this issue Jul 29, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@DaveWK
Copy link

DaveWK commented Jul 29, 2023

Description

I like the config based approach in Hyprland, but it can be confusing as a newcomer to enumerate and understand all the config options, and there's a potential for the dreaded combination of syntax errors and misconfiguration when trying to figure out how the config works.

It would be nice if I could edit my config in an IDE and it was able to validate my config syntax, ensure the configuration options have valid keys/values, and identify any problems with the "nesting" of objects being at the right height.

I would suggest using an existing open schema standard for validation to allow third-party apps such as IDE's, yaml/toml/whatever config macros, and extensions that generate some of the boilerplate config.

@DaveWK DaveWK added the enhancement New feature or request label Jul 29, 2023
@NotAShelf
Copy link
Member

@yavko

@yavko
Copy link
Contributor

yavko commented Jul 30, 2023

I am working on a parser and lsp that should at least help with ide stuff

@RichardFevrier
Copy link

Since we can source a file (multi-file configs) into hyprland config, wouldn't the lua file format more appropriate?

@sandhilt
Copy link

+1 for lua, most tools use this language for config

@vaxerski
Copy link
Member

no

@10b14224cc
Copy link

Here is a tree-sitter parser for hyprland config file, to be used with neovim: https://github.com/hyprland-community/hyprparse

@yavko
Copy link
Contributor

yavko commented Jan 24, 2024

Here is a tree-sitter parser for hyprland config file, to be used with neovim: https://github.com/hyprland-community/hyprparse

That's my parser, not the treesitter

@10b14224cc
Copy link

Here is a tree-sitter parser for hyprland config file, to be used with neovim: https://github.com/hyprland-community/hyprparse

That is the correct one: https://github.com/luckasRanarison/tree-sitter-hyprlang

@gnull
Copy link

gnull commented Apr 21, 2024

There's one more thing: maybe errors and syntax generally can be improved to help newcomers.

  1. Currently, the errors users get are really confusing. Like failed parsing a vec2: stof or failed parsing a vec2: no space with no further explanation if you get Vec2 wrong. (I'm guessing that the C++ code is doing some Codeforces-style parsing by hand and moving pointers around there.)

    Also, the Vec2 formats in hyprctl (10 20), in documentation ([10, 20]), and in config (10, 20) are all different.

  2. Argument structure is flattened into one list. Like

    bind = $mainMod SHIFT, left, movewindoworgroup, l
    

    while structurally this is more like bind(mainMod SHIFT, left, movewindowgroup(l)). Would be nice to have syntax that can reflect this structure and, if user gets it wrong, print an informative error message.

  3. Things that act as selectors get mixed up with things that act as property assignments.

    device {
      name = my-tablet
      active_area_size = 255, 160
    }
    

    The name might have been more appropriate in device[name=my-tablet] { }, not next to active_area_size that is assigning a property.

@vaxerski
Copy link
Member

this should move to https://github.com/hyprwm/hyprlang/

Possibly hyprwm/hyprlang#13

@vaxerski vaxerski closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants