-
Notifications
You must be signed in to change notification settings - Fork 27
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 including configuration files or Block template Inheritance #81
Comments
I agree, the config can get pretty unwieldy. I like these ideas, thanks! The config format we're using doesn't automagically support either of these, but:
templates = {
(
name: "normal_text",
block: TextBlock((
...
))
),
}
layout_blocks: [
...
(
name: "summary",
parent: "image",
hook: Hook(parent_anchor: MR, self_anchor: BL),
offset: Vec2(x: 0.0, y: 0.0),
params: "normal_text",
),
] Which isn't ideal, and doesn't solve the real problem where you want templates but want to be able to override some of the fields. Being able to override fields would probably require some craziness to support ergonomically. A cheap way to support "importing" may be for Wired to just additively pull in configs in the same directory with some prefix -- e.g. you'd have your "main" config |
This would already go a long way tbh.
What if wired only tried to load these files if they are specified somewhere in |
That's an option, will have to thinkt further about details of implementing that. |
I recently came across https://github.com/wez/wezterm, which does configuration in a lua file. Basically, you can run any lua code you like, then export the config in a local wezterm = require 'wezterm'
local prog
local font
if wezterm.target_triple == 'x86_64-pc-windows-msvc' then
prog = { 'pwsh.exe' }
font = 'JetBrains Mono'
end
if wezterm.target_triple == 'x86_64-unknown-linux-gnu' then
prog = { 'zsh' }
font = 'JetBrains Mono'
end
return {
enable_tab_bar = false,
default_prog = prog,
window_background_opacity = 1,
tab_bar_at_bottom = true,
font = wezterm.font_with_fallback {
font,
},
font_size = 11.0,
color_scheme = "Nord (base16)",
keys = {
{
key = 'RightArrow', mods = 'CTRL',
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
},
{
key = 'DownArrow', mods = 'CTRL',
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' },
}
},
} I think this is pretty much the direction to go in. We may even be able to move the notification criteria stuff into that as well. |
Hopefully you follow with it! Lua is a really good choice to make configurations! |
I'm in the process of adding a third notification type, and in doing so, I've found myself duplicating a lot more code than ideal, and the file configuration is 300+ lines long. So it's getting a bit unwieldy.
Have you considered either one or both of the following?
params
can be reused.The text was updated successfully, but these errors were encountered: