emersion / kanshi

Dynamic display configuration (mirror)
https://wayland.emersion.fr/kanshi/
MIT License
652 stars 46 forks source link

Apply or select a given profile #88

Open mvdan opened 3 years ago

mvdan commented 3 years ago

My config normally looks like:

profile docked {
    output DP-1  mode 2560x1440 scale 1 position 0,0
    output eDP-1 mode 2560x1440 scale 1.5 position 426,1440
}

profile mobile {
    output eDP-1 mode 2560x1440 scale 1 position 0,0
}

I want to add an extra profile whichis a variation on docked, but with one of the displays at 1920x1080 for the sake of 1080p streaming/recording. Imagine I call it recording.

I understand that kanshi is meant to be for automating selection of profiles via hotplugging, but it would be nice if I could also run something like kanshi recording to immediately apply a specific profile, and some other like kanshi reset to re-apply the default given the available outputs.

Or perhaps a different mechanism entirely, like a command or flag to cycle through the profiles which match the current outputs.

I realise that this feature is out of scope for the hotplugging design, but if I'm already defining my output profiles in the kanshi config, it seems out of place to have to use a separate tool and duplicate those options.

emersion commented 3 years ago

Yes, this is a planned feature. I mentioned it in https://github.com/emersion/kanshi/issues/10.

Part of the work necessary was started in https://github.com/emersion/kanshi/pull/52, but it would be nice to untangle this PR so that the commit adding signal handling is separate from the one adding IPC.

mvdan commented 3 years ago

Oh, nice. I searched but didn't find https://github.com/emersion/kanshi/issues/10 because the title didn't mention switching. Up to you if you want to close as a duplicate.