Setup Multiple Monitors in Sway (Wayland)

Published 2016-11-02 on Anjan's Homepage

Sway boasts about its close compatibility with your previous i3 config. However, if you used xrandr or arandr to setup the location of your monitors, your monitors will most likely not be in the correct location when you open up sway. There is a simple fix to this:

Get the names of your outputs by running:

swaymsg -t get_outputs

I have two monitors: one 1440p monitor plugged into the dvi port (called `DVI-I-0` in swaymsg) and one 1080p monitor plugged into my HDMI port (called `HDMI-A-1` in swaymsg). Therefore, I would write the following in my config:

output DVI-I-0 resolution 2560x1440 position 0,0
output HDMI-A-1 resolution 1920x1080 position 2560,480

I have the HDMI monitor set at y position of 480 because I have the HDMI monitor on a stack of books. If put y position as 0, my mouse jumps lower to where it was on the DVI monitor when I move across screens. Changing this to 480 makes it so I have consistent movement when moving between monitors. Adjust the y value if you have monitors of different resolutions.

Other things you probably want to fix

If you assigned different workspaces to different monitors, you may want to change this now:

workspace 1 output DVI-0

Would be changed to:

workspace 1 output DVI-I-0

Similarly, throughout the config where you would have used your old display name (in the example DVI-0), you may now use your new display name (in the example DVI-I-0).

Feh no longer works to set wallpaper. Use the following command in your config for sway to set the wallpaper:

output HDMI-A-1 bg ~/wallpaper.png stretch
output DVI-I-0 bg ~/wallpaper2.png stretch

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~anjan/public-inbox@lists.sr.ht [mailing list etiquette]

Articles from blogs I follow around the net

These articles/blogs do not represent my own opinions or views.

Todo.txt-more: Efficiently managing your todo list and your time

Todo.txt More: Efficiently managing your todo list and your time Introduction I tend to get fairly enthusiastic when it comes to lists, even more so when there's a chance to optimise my productivity. The end of the year is a time for looking backward an…

via Proycon's website December 31, 2022

The PineTab2 is a new, faster Linux tablet - and it's not alone

In their December update, Pine64 announced the PineTab2, which is the successor to their PineTab from 2018. As a major change, the PineTab2 upgrades the slow A53-based A64 SoC with an A55-based Rockchip RK3566, the same chip that was used for the Quartz64…

via TuxPhones - Linux phones, tablets and portable devices December 19, 2022

I shall toil at a reduced volume

Over the last nine years I have written 300,000 words for this blog on the topics which are important to me. I am not certain that I have much left to say. I can keep revisiting these topics for years, each time adding a couple more years of wisdom and impro…

via Drew DeVault's blog December 1, 2022

Generated by openring