emersion/kanshi

can't get kanshi to match a configuration

Closed this issue · 4 comments

sanga commented

Apologies beforehand if this is me missing something obvious (I feel like it must be) but the following behaviour seems odd to me

~/.config/kanshi
cat config
{
    output "*" mode 1920x1080
}
~/.config/kanshi
kanshi
Connected outputs:
output eDP-1 vendor AUO product 0x2036 serial 0x0
Matching configuration: None
Waiting for output changes...

How does "*" end up with Matching configuration: None? I've tried several different strings to a get a match but nothing seems to get picked up by kanshi (e.g. eDP-1) doesn't work either.

This is on ubuntu 19.04 and

sway version 1.1-rc1-55-gc9cb5ced (Jul  9 2019, branch 'master')
wlroots=df3f0ffbb0bcce8a12c83b577fd688a4ec290e7e

kanshi doesn't support quoted strings, yet. It would be a nice feature to add. Renamed the issue.

sanga commented

Fair enough. The man states that you’re suppose to quote strings with white space though doesn’t it? Also note that basically no string I added there could get a match, quoted or otherwise e.g. eDP-1 doesn’t match even though it appears that it should from kanshis output

Arguments can be quoted (with ") if they contain spaces.

Oh, sorry. We do support quoted strings: https://github.com/emersion/kanshi/blob/master/parser.c#L130

It seems you're using a very old version of kanshi, back when it was written in Rust. Please update to the latest commit.

sanga commented

Right. That was the "obvious thing" I referred to in my original post (I had both the rust and C versions installed but the rust one had precedence in PATH). Apologies for the noise.