scorpion-26 / gBar

Blazingly fast status bar written with GTK
MIT License
478 stars 17 forks source link

Add parsed nix config #23

Closed Eken-beep closed 1 year ago

Eken-beep commented 1 year ago

Add a way to write the gBar configuration in the nix language, like many other home manager modules, this spares, atleast nix users, from the trouble of using a new config language and integrates it nicer into existing home manager configs. Currently not all of gBars options have a nix option and some like SNIIconSize probably wont due to how they're made in the config, I could do it in a single string with both number and name but that looks ugly and there's still extraConfig. I have as ambition to update this while new options are added.

scorpion-26 commented 1 year ago

Thanks again for the PR!

Currently not all of gBars options have a nix option and some like SNIIconSize probably wont due to how they're made in the config, I could do it in a single string with both number and name but that looks ugly and there's still extraConfig.

I think that should be documented somewhere, which additional options can be set via extraConfig

I have as ambition to update this while new options are added.

Should I ping you, when there's something new?

Eken-beep commented 1 year ago

Should I ping you, when there's something new?

Well there's two solutions to that. First I could probably update this file when new features arrive and thats fine. We could also do it like, for example hyprland, and have a solution that just writes whatever into the config file and doesn't do any typechecks. It's easier but IMO a worse solution.

scorpion-26 commented 1 year ago

The hyprland one sounds like a bad solution. It doesn't check types, which I doubt gBar likes when there's a type mismatch. It shouldn't be too much work to just update module.nix (If you don't want to do that, I can do it as well though)

Eken-beep commented 1 year ago

That should be everything, should be clear how it works now LMK if you think some option is wrong. I can definitely update it however should just be as simple as adding a new option that looks like the previous ones as long as it uses a primitive data type (unlike sni config)

scorpion-26 commented 1 year ago

Just noticed, CheckPackagesCommand and CheckUpdateInterval are missing. Other than that, lgtm.

Eken-beep commented 1 year ago

I feel like those are basically redundant as you don't really check for that on nixos (as far as i know)

scorpion-26 commented 1 year ago

Makes sense. Thanks for your effort!