WayfireWM/wcm

--config option to choose custom configuration file.

marcusbritanicus opened this issue · 11 comments

Currently, wcm reads and writes to only ~/.config/wayfire.ini. It would be nice if the user could choose the configuration file, similar to how wayfire does it.

This is handled here.

You can set the environment variable WAYFIRE_CONFIG_FILE=/path/to/wayfire.ini

I think there is no reason to have WCM behave differently than wayfire and wf-shell, which support a command line flag.

@ammen99 The environment variables are nothing new, they've been around since 631954b.

If there is an actual reason to implement setting config file via option than environment variable and a patch to back it up, I will merge it.

In fact, I'd argue that wayfire and wf-shell should support this environment variable so a user wouldn't have to set it in multiple places, while reserving the ability to change it on CLI.

In fact, I'd argue that wayfire and wf-shell should support this environment variable so a user wouldn't have to set it in multiple places, while reserving the ability to change it on CLI.

Makes sense, although flags should be there too.

So you set the env var and a file as an arg. Who wins?

File as an arg.

Ok, then it could be:

  1. -c/--config takes precedence over env var.
  2. The line at the top of log 'Using config file ...' should be moved to wf-config, so its automatically logged as the first line to make it clear to all wf-config users what config file the application is using.

Ideally, I'd like to see this implemented in wf-config, wayfire, and wf-shell with documentation of this behavior somewhere.

Documentation would be nice. Also I can see why environmental variables are good from a desktop point of view. In Paperdesktop and DesQ we can set it during login and just opening wcm will start with the right config file.

Documentation would be nice.

Actually I learned only today WAYFIRE_CONFIG_FILE=/path/to/wayfire.ini . Can be that I've overseen it somewhere.