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

Allow Vendored Configuration File #2588

Merged
merged 2 commits into from
Feb 26, 2025
Merged

Allow Vendored Configuration File #2588

merged 2 commits into from
Feb 26, 2025

Conversation

janvhs
Copy link
Contributor

@janvhs janvhs commented Feb 25, 2025

This PR adds support for vendoring the Wayfire configuration file. In particular this means ${XDG_CONFIG_HOME}/wayfire/wayfire.ini will take precedence over ${XDG_CONFIG_HOME}/wayfire.ini while looking for a configuration file.

I opted to implement this change, since Wayfire already uses vendor-directories for plugin data in ${XDG_DATA_HOME}/wayfire/plugin. Furthermore, I spent way too long trying to find out why my default configuration is not working. I assume this change can reduce the maintenance burden, since people doing the same mistake will not open an issue or ask in IRC.
I copied it from /usr/share/examples/wayfire/wayfire.ini as packaged by my distro and therefore assumed wayfire uses the common vendor prefix pattern. While researching my problem, I found several threads where people likely did the same mistake.

This PR adds support for vendoring the Wayfire configuration file.  In
particular this means `${XDG_CONFIG_HOME}/wayfire/wayfire.ini` will take
precedence over `${XDG_CONFIG_HOME}/wayfire.ini` while looking for a
configuration file.

I opted to implement this change, since Wayfire already uses
vendor-directories for plugin data in `${XDG_DATA_HOME}/wayfire/plugin`.
Furthermore, I spent way too long trying to find out why my default
configuration is not working.  I assume this change can reduce the
maintenance burden, since people doing the same mistake will not open an
issue or ask in IRC.
I copied it from `/usr/share/examples/wayfire/wayfire.ini` as packaged
by my distro and therefore assumed wayfire uses the common vendor prefix
pattern.  While researching my problem, I found several threads where
people likely did the same mistake.
@janvhs
Copy link
Contributor Author

janvhs commented Feb 25, 2025

As an alternative approach, I'd love to add a log message, when ${XDG_CONFIG_HOME}/wayfire/ is present. This is most likely the first place to look, when debugging

@janvhs
Copy link
Contributor Author

janvhs commented Feb 25, 2025

The CI is failing because some files I did not touch are not formatted properly. Should I format and commit those as well?

@ammen99
Copy link
Member

ammen99 commented Feb 25, 2025

The CI is failing because some files I did not touch are not formatted properly. Should I format and commit those as well?

We use patched uncrustify to workaround some bugs. Look more closely at the CI output the command before the failed check tells you what you need to fix (spoiler: it is a file you did change :)).

@janvhs
Copy link
Contributor Author

janvhs commented Feb 25, 2025

The CI is failing because some files I did not touch are not formatted properly. Should I format and commit those as well?

We use patched uncrustify to workaround some bugs. Look more closely at the CI output the command before the failed check tells you what you need to fix (spoiler: it is a file you did change :)).

Oh noooo that's embarrassing lol let me rerun uncrustify right quick :D

Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@ammen99 ammen99 merged commit 2157d94 into WayfireWM:master Feb 26, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants