Skip to content

Drop -m flag#466

Open
emersion wants to merge 1 commit intocage-kiosk:masterfrom
emersion:drop-m-flag
Open

Drop -m flag#466
emersion wants to merge 1 commit intocage-kiosk:masterfrom
emersion:drop-m-flag

Conversation

@emersion
Copy link
Member

Tools can make use of the wlr-output-management-v1 protocol to configure outputs. Let's drop the "last" special case and leave all of the output configuration up to an external tool.

Tools can make use of the wlr-output-management-v1 protocol to
configure outputs. Let's drop the "last" special case and leave
all of the output configuration up to an external tool.
@n3rdopolis
Copy link

What is the best utility that uses wlr-output-management-v1 to set the compositor to use a single screen? or just do clone mode (with or without scaling) for something like fakekmscon?

@n3rdopolis
Copy link

n3rdopolis commented Dec 30, 2025

I do see Kanshi is in Debian, so I guess it can be a dependency for fakekmscon

I am testing it now

profile {
    output "*" position 0,0
}

gets me no profile matched though. I seem to be missing how to select the profile. (this using Cage with 3 wayland backends as my test...)

EDIT: I need the number of output lines to match the number of outputs in the profile, I guess I could create like 16 different profiles with 1-16 screens, that should more than cover it...

@emersion
Copy link
Member Author

emersion commented Jan 1, 2026

Yeah, hardcoding all of these outputs isn't super great but is a viable workaround. For a proper fix: https://gitlab.freedesktop.org/emersion/kanshi/-/issues/11

For output mirroring, see https://gitlab.freedesktop.org/wlroots/wlr-protocols/-/issues/101

@n3rdopolis
Copy link

n3rdopolis commented Jan 2, 2026

Yeah, hardcoding all of these outputs isn't super great but is a viable workaround. For a proper fix: https://gitlab.freedesktop.org/emersion/kanshi/-/issues/11

For output mirroring, see https://gitlab.freedesktop.org/wlroots/wlr-protocols/-/issues/101

I will take a look. However I am realizing that upon creating the full file, the profiles that specify more screens than there actually are, cause "duplicate output" errors, so it might not be viable at this point, unless I am doing wrong.

(If I have 3 outputs, and a profile with 4 output lines, it gets treated as a duplicate, and errors out the parsing)

I'm thinking maybe I can trap SIGWINCH, and use wlr-randr, to enumerate and then position the outputs with wlr-randr...

@joggee-fr
Copy link
Collaborator

joggee-fr commented Jan 2, 2026

Is it possible to use kanshi to reproduce the -m last behavior?
I suspect the use case is one main display and a random monitor that can be plugged in a dedicated output. Just like a laptop with LVDS-1 as main output and HDMI-1 for external monitor.

@emersion
Copy link
Member Author

emersion commented Jan 4, 2026

Something like this maybe:

profile {
    output eDP-* enable
}

profile {
    output eDP-* disable
    output * enable
}

I've opened this feature request to be able to easily write any kind of output config logic with a wlr-randr script: https://gitlab.freedesktop.org/emersion/wlr-randr/-/issues/3

@joggee-fr
Copy link
Collaborator

In the same topic, I think it would be nice if Cage does not try to configure a new output if a Wayland client is currently registered as a wlr-output-management protocol listener.
However, I am afraid handle_new_output() will be called with already existing monitors before a Wayland client even has the chance to be started.

@emersion
Copy link
Member Author

emersion commented Jan 4, 2026

In the same topic, I think it would be nice if Cage does not try to configure a new output if a Wayland client is currently registered as a wlr-output-management protocol listener.

Ref #452

@emersion
Copy link
Member Author

@n3rdopolis For your use-case, kanshi v1.9 now supports this syntax:

profile {
    ...output * position 0,0
}

@n3rdopolis
Copy link

n3rdopolis commented Feb 11, 2026

I do see that, and I did pounce on that already in fakekmscom.

I do think though adding this to cage is slightly more compact, I already have foot calling a script, but other users would have to call kanshi from a script that is also called by cage

Although the binary is pretty small, so the size doesn't matter as much, seeing that initrds are compressed for vt-less systems that need Cage for the panic routine.

Also this constrains the regions to the smallest screen instead of the largest, IMO, it's more usable for a terminal, but that's just my opinion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments