mako
mako copied to clipboard
FR: Support output configuration across different systems with differently-named outputs
I'm trying to share a dotfiles repo between two systems with mako (plugged into the same monitors but different outputs, so they have different names), and am wondering how to specify the output
parameter. https://github.com/emersion/mako/pull/228/ mentions the possibility of going down a list of output
s until one is available which would work. Another more heavy-handed approach would be to include other config files.
Any opinions either way? I could try my hand at this PR.
Ref https://github.com/emersion/mako/issues/314
On Mon, 10 May 2021 at 08:56, Simon Ser @.***> wrote:
Ref https://github.com/emersion/mako/issues/314
This still describes having one output - unless you mean your suggestion of assigning layer surfaces to outputs? How would that work with different criteria leading to different outputs?
Thanks, Radu
Yes, this is just one part of the feature you describe.
Another potential hack: allow access to host information in criteria. Since output is a style option and style options can be set according to criteria, this would allow you to write configs like this:
[hostname="desktop.personal.com"]
output=DP-2
[hostname="laptop.personal.com"]
output=eDP-1
[hostname~=".*\.corp\.work\.com$"]
output=HDMI-3
It's a horrible abuse of the criteria system, but I think that it would work, and the implementation wouldn't be particularly nasty - add hostname
and hostname_pattern
fields to struct mako_criteria
and populate them in apply_criteria_field
, add the appropriate branch to match_criteria
. Could grab the hostname in match_criteria
but that seems ugly, so instead also add hostname
to struct mako_notification
? A bit of extra copying but scale should be teeny so carting around a copy of the hostname on all notifications shouldn't be noticeable. Anything I'm missing? If not, I might try throwing a PR with that design together sometime, if only for my own use.