mako
mako copied to clipboard
Cannot use commands as config values
I am trying to write my config file in such a way that it will dynamically obtain a colorscheme from pywal, by trying to extract the values from a file containing the loaded colorscheme, e.g. border-color=$(sed '3q;d' ~/.cache/wal/colors)
. However, mako does not seem to support this, and the manpages make no mention of something like it, and I was wondering if there exists some mechanism in mako to achieve this, or if this might be a possibility for a future release.
Indeed, there's no support for this. As an alternative, you could generate the entire config file from a template when wal creates a new scheme, and use makoctl
to reload the config.
Possibly related: https://github.com/emersion/mako/issues/138
Maybe mako/config
could have an include
command to load external files just like we do on sway/config
.
I'd rather not go down that path, I think it would make interactions between criteria very difficult to understand since they're executed in order but would be split across multiple files.
For me, passing the colors to mako through cli parameters when calling it from the sway config works:
include "$HOME/.cache/wal/colors-sway"
[...]
exec --no-startup-id mako --background-color "$background" --text-color "$foreground" --border-color "$color13"
But this is not dynamic. I guess you could kill and run mako everytime you reload sway?
exec_always kill $(pgrep mako)
exec_always --no-startup-id mako --background-color "$background" --text-color "$foreground" --border-color "$color13"