Sway: monitor configuration for different computers

I’m using Sway (not as my daily driver) on different computers: PCs and laptops.

For the PCs, I’m using an HDMI monitor. Laptops have different display sizes, e.g., small displays with low resolution and more extensive displays with retina resolution. Thus, I need to set different scaling factors for the different displays.

It’s pretty easy in Sway, and I’ll detail that here.

First, you need to get the information Sway uses to refer to your current monitor:

For example, on my LG GRAM 16, I get:

I want to scale at 1.6 on this computer. Otherwise, I can’t read almost anything.

In “~/.config/sway/config”, I specify scaling for this computer using the name shown above

Reload the configuration, and now scaling is correctly applied when using this laptop.

On the other laptops (e.g., my Acer Aspire Vero), I repeat the same procedure: get the identifier and add a specific configuration with the identifier; for example, for this other laptop, 1.25 scaling is enough:

For HDMI monitors, I want 1.5:

Summarizing, this is the monitor section in my Sway configuration, which automatically sets the desired scale factor according to the computer I’m using:

Of course, you can change many values for each monitor, including resolution and orientation, by specifying the corresponding identifier.

In my case, I only want to change the scaling factor.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.