Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Add support for overriding config file. #671

Closed
wants to merge 2 commits into from

Conversation

HugoNikanor
Copy link

Allows '-C' flag to specify a config file which should take priority
over already set config. Ideally multiple config files should be able to
be loaded in this way. See this as more of a proof of concept.

I personally wants this to easily switch fonts without copying my whole config.

Allows '-C' flag to specify a config file which should take priority
over already set config. Ideally multiple config files should be able to
be loaded in this way. See this as more of a proof of concept.
@jelly
Copy link
Collaborator

jelly commented Apr 30, 2019

This looks like a workaround for something, iirc termite supports reloading of the config file.

@HugoNikanor
Copy link
Author

@jelly This is separate from reloading config files. It instead allows the user to supplement an additional config file which can override default. I do agree that this might be a bit of a workaround-ish solution.

@wlhlm
Copy link

wlhlm commented May 2, 2019

This should be documented in the man page in case this gets merged.

@HugoNikanor
Copy link
Author

I added a note in the appropriate man page.

However, I would still like to see some further thoughts on a feature like this.

@polyzen
Copy link
Contributor

polyzen commented Jun 13, 2019

#260

@HugoNikanor
Copy link
Author

@polyzen I also like that approach, but @thestinger was was apparently against without giving a reason.

@ifohancroft
Copy link

ifohancroft commented Oct 7, 2019

This is already possible with the present -c option.
termite(1):

-c, --config=CONFIG
Specify a path to an alternative config file to use.

If it's something else you are asking for - please elaborate.

@HugoNikanor
Copy link
Author

@ifohancroft I'm well aware of the -c flag. My use case for this is to have multiple really similar configs (which I can choose between with the -c flag) and then some minor amendments I can load with the -C flag. I currently use it to create a new instance with a different font but all other settings intact.

@ifohancroft
Copy link

@HugoNikanor I am sorry. I misunderstood your use case. I get now what you are trying to do and I think the idea is cool. I am not sure about the implementation though.
I am thinking a cooler or more elegant way would be to either present what's in the config, also as a runtime option that takes precedence over the config or maybe modifying how -c works, so instead of just loading what's provided by -c, it also loads the default config file and what's present in both the default one and in the -c one, the -c one overrides it.

@HugoNikanor
Copy link
Author

@ifohancroft Your second idea sounds like making the -c flag act as my -C flag. I would like to think that it's a bad idea, since I excpect -c /dev/null to load default setting. That however doesn't work with the error /dev/null parsing failed: Not a regular file. So it could be an idea.

Regarding your first idea. Do you mean something along the lines of -o options.font='Fira Mono 8'?

@ifohancroft
Copy link

@HugoNikanor Why would you expect -c /dev/null to load the default setting? Instead of passing /dev/null to -c, wouldn't it be better to just not specify -c? I mean, after all termite by default is looking in a specific dir for the default config file.

As for the first idea. Your idea to combine them under a single option is nice. Like -o options.font='Fire Mono 8'. I was thinking more like separate options:
--font='Fire Mono 8' --color0='#000000', etc

@HugoNikanor
Copy link
Author

HugoNikanor commented Oct 8, 2019 via email

@ifohancroft
Copy link

ifohancroft commented Oct 9, 2019

This sounds a bit of an overkill. Also, I think Termite doesn't have built-in defaults and reads them from the config file. I think it would be sufficient to just read the default config, also of course, the current - c option to load an alternative config instead and options when running it like --color0, --color1, etc to override just the specified. The same can still be achieved this way.

@thestinger
Copy link
Owner

Termite is obsolete. Please use Alacritty instead. See https://github.com/thestinger/termite#termite-is-obsoleted-by-alacritty for more details.

@thestinger thestinger closed this May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants