-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Profiles #83
Comments
I think that's the key part here. The story will be achieved by setting the explicit configuration per-profile. Falling back to a default will still be useful. The behaviour of new displays can be best effort configured by profile or default, adding a new profile if needed. My workarounds:
|
Keep in mind the CLI. You can configure persistently or ephemerally. You can also use the IPC API if you're sufficiently motivated. See #65 which will add user hooks. Regardless, profiles are a desirable solution. |
Can you please draft some rules that we may add to cfg.yaml? My imagination is poor and can't see much beyond hostname or display name. |
I use YADM - its per-host files feature can do this. I plan to add a Nix Home-Manager module for way-displays, which can differentiate per-host. Still, one config across machines seems like a nice convenience.
Oh, a comp/shell keybind to toggle the arrange/align would be nicer than editing the config file. Thanks!
I'd guess for a majority of users one arrange/align value will work across all their stations. I don't want to nudge you into adding features YAGNI! |
It seems like the only really necessary dynamic profile matching criteria is that a given set of outputs are present.
I first thought overloading the Maybe there's still a way to make profile matching work via the PROFILES:
a-profile-with-no-match-rule-always-applies:
ARRANGE: COL # by default, unknown displays go above the laptop screen, eg for projectors
ALIGN: MIDDLE
ORDER:
- '!.*$'
- 'eDP-1' # eDP-1 defaults to last
horizontal-laptop-right:
MATCH:
- '!(^Sharp Corporation 0x148D$)|(^Dell)' # When either of these displays are present, apply this profile atop the previous one
ARRANGE: ROW
ALIGN: BOTTOM
hackerspace:
MATCH:
- 'Sharp Corporation 0x148D'
- 'Monitor Maker ABC123' # When both of these displays are present, apply this profile too
ORDER:
- 'eDP-1' # in the hackerspace, laptop is on left
- '!^Sharp'
- '!^Monitor Maker' WDYT?
@matthewwardrop also curious if you have feedback/ideas here. |
PROFILES:
horizontal-laptop-right:
MATCH: That works. Keeping it simple, all params could go in each profile, overriding defaults. Merge methods are already present. PROFILES:
a-profile-with-no-match-rule-always-applies: We could just use the toplevel defaults instead of a default profile. Bonus points for Martin Fowler reference. |
There will be a nice solution for Even if we don't implement host matching, we should leave the door open for it and other future matches. @matthewwardrop ideas please! |
I think we can trust the user. If they get a match for each of the match displays, the (edit: first) profile applies. It would be documented. |
Hi! Sorry for the delay, with things busy at work and with four munchkins at home, I don't have as much time as I'd like to clear out my inbox. I also like the idea of context specific overrides... But like @edrex I use YADM as a workaround for this on my machine. If support were added, I'd keep the config as is, and then have context overlays that are matched in... Something like:
You could even have match at the top-level too, where if provided and match is not satisfied, way-displays disables itself. This simplifies parsing a bit too, since the syntax could be arbitrarily nested and always have the same schema. |
Interesting. That would need to be an explicit setting as there's no means to set options that will disable everything.
Yes. Same schema at root or inside a profile. The above setting would just be another entry in the schema. |
If we went with something like I suggested, an empty parsed config would be that configuration option. Oh, and I guess I'm less a fan of "profiles" as context specific instructions or "overlays". Profiles makes it sound more top-level (all or nothing, take the work profile, or the home profile, etc). I guess for me a profile is the evaluated entire state that is derived from matches /etc. This is probably just semantics. |
Thinking more, I'm not sure how "do nothing" would look; there are no "defaults" to go back to when the user instructs "do nothing". It should become more clear after profiles exist and the user switch between them via CLI or hotplug.
That makes sense - it's the base overridden by the profile. Fortunately all that code exists. |
Okay, I see there are strong reasons to keep config backwards compatible by leaving toplevel options in place.
I can't speak to ease of implementation, but allowing deeply nested blocks seems confusing for users. No strong opinion as long as the use case is satisfied.
Good names are important, and worth thinking about. Overlays does tell you how they work, if you know what an overlay is, which is a nice property. I feel like it sounds like a compositor thing which might be confusing. What about
I don't see a use case for having a matching rule at the top level, but maybe I'm missing something. Sorry slow response, got dogpiled by life :) |
I realized that keys like like ORDER probably don't actually have a default value in way-displays, and instead the compositor is providing a default (which might just come from the enumeration order from the kernel). Thinking about this some more, I don't see a need for (programmatic) default values at all: when matched blocks change (default or no) all config from matching blocks (including default) applies, but keys that aren't explicitly set aren't applied (and the compositor decides what to do). Easy. |
That's the issue. Wayland itself does little other than enable preferred mode on displays. River does nothing, sway applies a general left to right in discovered (unpredictable) order.
That is all we can do. |
That's non-negotiable. Profiles/overlays are additions.
We don't have any need for nesting; one level is enough. The user can write match rules for each one. There may be a bit of repetition but that's Too Bad.
Naming is always hard. Build it with a placeholder and things will become clearer during implementation. After a merge is implemented and demonstrated in a real situation it should give some insight.
I don't think that adds anything but confusion. KISS: profile/context + top level or top level |
As a floating laptop user, I would like have different config blocks dynamically applied depending on which outputs are connected.
Design constraints:
IMO what is needed is a kanshi-style "profiles" mechanism where each profile has a set of matching rules and a config block to apply. The profiles could be mutually-exclusive (first match wins) or layered (which would allow flexibly specifying defaults). This way, all config keys are subject to matching, and new matching rules can be added to introduce new axes of conditionality.
Workarounds
Currently, I have multiple commented blocks and whenever I switch stations, I open the config in my editor and switch the active one. It's not a huge deal, and I like it way better than the kanshi UX. This could also be done via the IPC mechanism, but that just kicks the ball down the road.
Anyway, I'm happy with things as they are now but I see the focus making ORDER super flexible as a distraction.
The text was updated successfully, but these errors were encountered: