~emersion/kanshi#86: 
Not running as daemon

One of the value proposition of kanshi is the nice profile detection and configuration. I'd like to use that without relying on kanshi to detect the changes. Similar to how autorandr --change works, could you implement a one-shot way to run kanshi?

Status
REPORTED
Submitter
~diaoul
Assigned to
No-one
Submitted
1 year, 9 months ago
Updated
2 months ago
Labels
No labels applied.

~emersion 1 year, 9 months ago

Hm, how would that work exactly? Who would be responsible for invoking the one-shot mode? Would the user manually do that? Why is the daemon approach not suitable for you?

~diaoul 1 year, 9 months ago*

  • Hyprland provides a way (through IPC) to listen to monitoradded/monitorremoved events and perform actions following those, I use that with a couple of shell scripts to circumvent https://todo.sr.ht/~emersion/kanshi/54#event-235509
  • If you don't want an instant switch for some reason and keep control of when that happens
  • Or if you want to activate another profile than the one that is detected (e.g. you want to stay on laptop monitor even though plugged in to another display)
  • I had a 144Hz monitor that was very slow to light up, causing issues with autorandr (not sure it would've been the case with kanshi, don't have that monitor anymore)

Overall, my main usage matches the daemon way of running it. It's just a bit harder to handle other less typical usages.

~spacefrogg 2 months ago

I want to second this. The daemon approach alone is "incomplete" in the sense that I sometimes need different monitor configurations despite the monitor connections unchanged. This was my main use for autorandr actually: I am in some foreign setup (I hold presentations a lot) and want to select "only beamer", "beamer and laptop" etc. depending on the situation I am in. Profiles cannot capture this, because the two profile configurations would look identical and there is no decision mechanism (other than myself) that can pick the right one.

~emersion 2 months ago

You can do this with kanshictl switch.

~spacefrogg 2 months ago

I am aware of kanshictl switch but I fail to understand its usefulness. How can I define several profiles that all match the same set of monitors and just differ in which of the monitors gets enabled or how they are positioned relative to each other? autorandr has the generical horizontal and vertical profiles for that, for example. As I have seen from the logs, kanshi will just activate them one after the other, which is not what I want. I want to switch to them only manually, because I want to use them on circumstance that kanshi cannot know about.

~emersion 2 months ago

You can define multiple profiles with the same set of outputs. By default, kanshi will activate the first one. You can then use kanshictl switch to activate the second one.

Register here or Log in to comment, or comment via email.