Closed giorgosioak closed 6 years ago
Config as in the configuration file or as in the entries file (which was previously known as the config)? It already reads ~/.config/xlunch
for the entries.dsv
file, so I'm guessing the config. I guess we could do that, only problem is that I think there are still some options that behave differently when unset. So not setting those options will end with functionality not obtainable by setting it to anything else. This used to be the case for spacing at least, where setting a border would lead it to not auto-calculate the border.
I'm not talking about entries.
You can have the default config at /etc/xlunch/config
So if someone wants to make their own config they gonna make a new at ~/.config/xlunch/config.
Making this way allows to users to create themes and share their config and save it in dotfiles in GitHub repos. A huge plus to users that want to try themes.
I guess we could do that, only problem is that I think there are still some options that behave differently when unset.
There is no need to set them.
The /etc/... config will have a full list of default options commented out without setting them to a value.
example: #font:Sans/10
You can still have: (read with priority)
Ah, that makes sense. Certainly something we could do.
I assume you mean only the options that have defaults right? Desktop mode for example, enabled with --desktop
is disabled simply by leaving out desktop
from a config file.
@PMunch Yeah, like background, font etc.
You can make desktop:true or false or you can not accept it in config.
You know better. How you handle desktop mode now?
Also, if someone choose --config path/to/config the that ignores the user config
Desktop mode is handled on the command line if you pass --desktop
without any parameters. In the config file it is handled by the presence of desktop
without any parameters. Putting it in this default config commented out might make it seem like that is the default, if we also comment out other defaults.
We could of course not comment out the actual defaults, leaving them to be read from the file, only defaulting to the internal value when the file is missing.
I agree
I've added a config file in /etc/xlunch/default.conf
and made it read configs in this prioritised order:
--config
~/.config/xlunch/xlunch.conf
/etc/xlunch/default.conf
What do you think?
Awesome!
I'm assuming that means you're happy with the solution so I'll close this :)
Hello, can you make it read by default config in ~/.config/xlunch/config ?
Also can you make a "default" config in /etc/xlunch so users can be based on it? Mostly commented out the default values would be perfect.
My suggestion is to read by default as: ~/.config/xlunch/config /etc/xlunch/config
Thank you, G.I