First, I’ve been exploring how to make different settings for different displays, and formulated this for sway’s GitHub. Before I realised I can approach displays by their IDs.


Is it possible to connect different displays to the same port and have different settings for them? Based on their names / models, I guess. Seems like either it’s not, or its syntax is unclear to me.

Use case: I work with my laptop from different places, and I attach it to an external display, which may be positioned differently.

  • Also, displays could be of a different size and resolution. While resolution works automatically, its position would be different anyway, especially if the displays are different,
    • e.g. I have 1920x1080 or 2560x1440 displays, both being upside, so it’s either pos -320 -1080 or -640 -1440 for me.

I tried to specify the name with quotes, e.g.

output DP-1 'Apple Computer Inc LED Cinema 2A0231UX5JL' pos -640 -1440

or

output 'DP-1 Apple Computer Inc LED Cinema 2A0231UX5JL' pos -640 -1440

But I’m getting errors with that.

I didn’t know how to properly formulate this for search, so I haven’t found anything. Before posting, I tried to ask ChatGPT, and it came with the same approach, when I asked to use names, only it suggested wrapping it in extra quotes:

output "DP-1 'Apple Computer Inc LED Cinema 2A0231UX5JL'" pos -640 -1440

Which didn’t work either.

While ChatGPT hallucinated me some crazy workarounds (e.g. running a script all the time, or switching with hotkeys), I came up with a simple workaround: having a drop-in config file, which I may (or may not) include to overwrite the standard behaviour. While being okayish enough for me, I would appreciate having a simpler solution of specifying the exact model/name of the display in my config and let sway to work with that. Instead of juggling with config files each time I’m about to connect different display.

Does anyone know if that’s possible in the current realisation? If not, is it sane to implement this? (Just curious, may be completely out of scope.) As this works perfectly fine when I use different ports, e.g. DP-1 or HDMI-A-1. While this port-display combination is static for my desktop, it’s dynamic for my laptop.

Also, my inputs


Here I realised I can see how it’s there, and it works. I needed to wrap just the name of my output in quotes.