mako icon indicating copy to clipboard operation
mako copied to clipboard

Cannot use commands as config values

Open daanjderuiter opened this issue 4 years ago • 5 comments

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.

daanjderuiter avatar Oct 05 '19 23:10 daanjderuiter

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.

vilhalmer avatar Oct 05 '19 23:10 vilhalmer

Possibly related: https://github.com/emersion/mako/issues/138

emersion avatar Oct 10 '19 00:10 emersion

Maybe mako/config could have an include command to load external files just like we do on sway/config.

aleprovencio avatar May 28 '20 18:05 aleprovencio

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.

vilhalmer avatar Jun 01 '20 13:06 vilhalmer

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"

ZJaume avatar Nov 25 '20 15:11 ZJaume