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:
1 |
swaymsg -t get_outputs |
For example, on my LG GRAM 16, I get:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Output eDP-1 'LG Display 0x0694 Unknown' (focused) Current mode: 2560x1600 @ 59.994 Hz Power: on Position: 0,0 Scale factor: 1.000000 Scale filter: nearest Subpixel hinting: unknown Transform: normal Workspace: 1 Max render time: off Adaptive sync: disabled Available modes: 2560x1600 @ 59.994 Hz |
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
1 2 |
# LG GRAM 16 output "LG Display 0x0694 Unknown" scale 1.6 |
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:
1 2 |
# Acer Vero output "AU Optronics 0x0C9C Unknown" scale 1.25 |
For HDMI monitors, I want 1.5:
1 2 |
# HDMI monitor output "HDMI-A-1" scale 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:
1 2 3 4 5 6 7 8 9 10 |
### Output configuration # HDMI monitor output "HDMI-A-1" scale 1.5 # LG GRAM 16 output "LG Display 0x0694 Unknown" scale 1.6 # Acer Vero output "AU Optronics 0x0C9C Unknown" scale 1.25 |
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.