Lyr-7D1h / swayest_workstyle

Map workspace names to icons for Sway
MIT License
119 stars 18 forks source link

add second User config #12

Closed Mathew-D closed 3 years ago

Mathew-D commented 3 years ago

Add a second config file called: user-config.toml. This allows linux distribution to prepackage a config file and users to add there extras to another file for easier updates of dotfiles

boredland commented 3 years ago

closes https://github.com/Lyr-7D1h/swayest_workstyle/issues/11

Lyr-7D1h commented 3 years ago

Hi @boredland @Mathew-D sorry I'm so late to the party currently on vacation. What if we would give an option to make it easier to build the project with a different default_config? Would that solve the problem? Im not sure how user-config.toml would make dotfiles easier.. It would be easier to have have just one config file in my opinion.

Cudos btw for being the first pr on this repo ;)

Mathew-D commented 3 years ago

The main reason for a second config is that a custom one can be set by a setting package which will be updated by Linux distribution but the second one will only be changed by the user and will not be replaced every time the setting package is updated.

Lyr-7D1h commented 3 years ago

Is this a known pattern for configs? So then config.toml will be more of an constantly updating fallback instead of the only config? Wouldn't it be better for distros to bake in the default config? And still just leave one file? There kind of is no point to having two config files if one will be overwritten and handled by the package manager.

boredland commented 3 years ago

Wouldn't it be better for distros to bake in the default config?

while I personally agree, I think there is scenarios for both files:

  1. regular config provided in and updated by a distribution
  2. people adding their personal flavor (different icons, icons for tools not in the list)

reg. 2. I think this solution doesn"t cover this completely, because imo we'd basically need to filter out duplicates and keep only every last entry, so we could support "overrides". clearly not a high priority though.

Lyr-7D1h commented 3 years ago

Okay so lets not give users a config file maintained by the distro. Lets just use the default_config.toml together with config.toml. and make it easier for package maintainers to change default_config.toml to a desired state.

This way you can have an ever changing default config specific per distro while always preferring user config over default.

So two changes needed:

boredland commented 3 years ago

But that way, you'd loose the option to "update" the "os part" later.

Lyr-7D1h commented 3 years ago

I'm not sure if I understand. But a package maintainer can still update default_config.toml henceforth it can update the "os part"

boredland commented 3 years ago

sorry, I over-read parts of your comment.

Mathew-D commented 3 years ago

I hate to say it but what you are asking for is above what I can program in rust as I normally only program in Java.

Lyr-7D1h commented 3 years ago

@Mathew-D no problem thanks for putting time into this as far as you have. It helped with the discussion!

Lyr-7D1h commented 3 years ago

@boredland I'm not sure if you're able to implement this otherwise I'll be able to work on this but only after a minimum of a week. Can't release anyways untill I'm back home..

Mathew-D commented 3 years ago

Pull #13 closes this.