emersion / mako

A lightweight Wayland notification daemon
https://wayland.emersion.fr/mako
MIT License
2.2k stars 139 forks source link

Cannot use commands as config values #192

Open daanjderuiter opened 4 years ago

daanjderuiter commented 4 years ago

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.

vilhalmer commented 4 years ago

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.

emersion commented 4 years ago

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

aleprovencio commented 4 years ago

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

vilhalmer commented 4 years ago

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.

ZJaume commented 3 years ago

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"