-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: select subtemplate based on the scheme used #66
feat: select subtemplate based on the scheme used #66
Conversation
Hello! Thanks a lot for the contribution :D It's a very valid usecase. I was wondering if perhaps we could make this more explicit and transparent instead of it being implicit behaviour (a subtemplate/scheme name collision is unlikely, but very possible). What if the user could use a [[items]]
file = "~/.config/sway/config"
template = "sway"
subtemplate = "{scheme}"
hook = "swaymsg reload" Would you be interested in making this change? |
The flavours/src/operations/apply.rs Line 32 in 606817e
|
Hey sorry, I was on holidays and just now came back. Thanks for your feedback! Sounds like a good idea with the {sheme} placeholder to make it more explicit. I'll implement it over the weekend :) I'd keep the behaviour that if no subtemplate with the scheme name/slug is found, then "default" is selected. |
Welcome back! Hope you rested well.
Thanks a lot! |
Didn't get to it last weekend, but have implemented it now. The search for a scheme dependent subtemplate now only happens if the subtemplate's value in the config is set to |
Looks good to me! Thanks a lot for the contribution (and sorry for the wait)! |
Solves #65. It is not ideal, since I call
find_template
twice, but it gets the job done. I could change thefind_template
function to also receive the scheme as a parameter and give that back if a subtemplate with the scheme name is found, but well I'd like to first hear from you :)