How To Configure Multi Monitor In Wayland Sway

Sdílet
Vložit
  • čas přidán 11. 09. 2024
  • Multi monitor works fine on Xorg but it's a bit finicky luckily on the Wayland and Sway side it's so much easy and when it's working it works amazingly
    ==========Support The Channel==========
    ► $100 Linode Credit: brodierobertso...
    ► Patreon: brodierobertso...
    ► Paypal: brodierobertso...
    ► Liberapay: brodierobertso...
    ► Amazon USA: brodierobertso...
    ==========Resources==========
    SwayWM Website: swaywm.org/
    =========Video Platforms==========
    🎥 Odysee: brodierobertso...
    🎥 Podcast: techovertea.xy...
    🎮 Gaming: brodierobertso...
    ==========Social Media==========
    🎤 Discord: brodierobertso...
    🎤 Matrix Space: brodierobertso...
    🐦 Twitter: brodierobertso...
    🌐 Mastodon: brodierobertso...
    🖥️ GitHub: brodierobertso...
    ==========Credits==========
    🎨 Channel Art:
    All my art has was created by Supercozman
    / supercozman
    / supercozman_draws
    #linux #wayland #sway #archlinux
    🎵 Ending music
    Music from filmmusic.io
    "Basic Implosion" by Kevin MacLeod (incompetech.com)
    License: CC BY (creativecommons...)
    DISCLOSURE: Wherever possible I use referral links, which means if you click one of the links in this video or description and make a purchase I may receive a small commission or other compensation.

Komentáře • 88

  • @BrodieRobertson
    @BrodieRobertson  Před 2 lety +16

    I made one slight mistake, I said you can't use the monitor names when applying settings, that's incorrect I just mistyped the names during testing. It's probably still easier to use the port names unless you're constantly swapping your displays around for some reason

  • @raiguard
    @raiguard Před 2 lety +3

    Multi monitor config on Wayland (and specifically Sway) is such a dream to use. On xorg, I had endless issues with my TV when it came to scaling, Fullscreen applications, and switching between it and my desk monitors. On Sway, it just... Works. I have three different monitors with three different refresh rates, one of which has VRR enabled, and they all just work. It's magical.

  • @Jelster64
    @Jelster64 Před 2 lety +2

    this is one of the greatest parts of desktop linux. i have a tv that can either do 1080p@120 or 4k@60, sometimes i wanna use it, sometimes i don't. so i figured out all the presets once (120single, 120triple, 4ksingle, 4ktriple, double), saved them as scripts and now use dmenu to select them with a keybind. windows or macos couldn't dream of this convenience

  • @linkert810
    @linkert810 Před 2 lety +4

    Love your Wayland series :)
    To me, Wayland and sway makes Xorg feel like a beta product in some respects. Like if you are one who fudge about with alternative keyboard layouts. On X, my Dvorak layout would work fine for most applications yet not in Inkscape. It just would not respect my keyboard layout (XFCE, bspwm, dwm, spectrwm and what not). On Wayland it's flawless.

  • @bepis2679
    @bepis2679 Před 2 lety +2

    On Sway with 3 outputs of mixed resolutions and mixed refresh rates and it works perfectly for me.

  • @Gotblade
    @Gotblade Před 2 lety +3

    I had myself convinced that I preferred multiple displays because I had an expensive graphics tablet but when it failed I couldn't afford to replace it. For me it comes down to having an excuse to configure something so I can be proud of having understood the instructions. More than half the time the extra display was sitting idle with windows I thought I might look at eventually... for months on end. I now use a drawing tablet that cost less than 60 dollars sitting on a platform I made with my 3d pen (less than 30 dollars) at an ergonomic angle, every bit as comfortable as the fancy one that died. I'm trying to be a little more focused on the task at hand and that suits my limited attention span ☺

  • @AshnSilvercorp
    @AshnSilvercorp Před 2 lety +1

    I only really ran into Wayland as a result of the KDE suite installation I got on Arch defaulting to it. I really haven't needed global keys as of yet, and really I've been mostly fine as I really don't have the power-user setup yet to be bothered significantly like it. I've treated a ton of it as growing pains from dropping Windows.

  • @jeffsadowski
    @jeffsadowski Před 2 lety +2

    I use 4 monitors. I use them with xfce. I used the gui tool that came with xfce to set the positions.

  • @FlorianZier
    @FlorianZier Před 2 lety +2

    I would like to use Sway (or at least a KDE wayland session). But there are currently two dealbreakers.
    1. The missing global Hotkeys
    2. The Scaling in Xwayland is unfortunately just unusable, especially with different scalings. Let's say one monitor is 2560x1440 scaled by 1 and another 3840x2160 scaled by 1.5. Applications on wayland itself work just fine and scale the UI properly. But when using Applications via Xwayland on the bigger monitor, they only get 2560x1440 pixel to render instead of 3840x2160. Then all gets a blurry integer scaling to stretch it across the monitor. You basically have less pixels to render into. The easiest way to see this, is starting a game with ManguHud enabled. Compare the image with Xorg, where scaling only affects things like the font size on your UI and a game has access to the full 3840x2160 resolution. On Xwayland the overlay will tell you it renders at 2560x1440 pixels and you can see it's way blurrier. Currently I only found one possible workaround with gamescope. If you use sth. like "gamescope -f -e -w 3840 -h 2160" (-e to fix a non working mouse in steam games when using gamescope) in launch options of a normal Steam installation, some games get a proper new context to render with 3840x2160 pixels. But it doesn't work in every game, I guess when they are recreating their render context, maybe a launcher thing. In some games you get intro videos with full resolution, then it fallbacks to lower resolution after loading the main menu. Another problem is, it seems like gamescope is currently not usable in Flatpaks. Steam, Heroic, Bottles, nothing starts a game with gamescope (despite installed com.valvesoftware.Steam.Utility.gamescope).
    I really like waylands ability to applay different monitor scalings. But I still prefer an Xorg session with a global scaling, where I can still scale down the contents in a webbrowser on my second monitor or just live with the bigger UI on it.
    What I don't want are all that 32bit dependencies with a system installed Steam, especially while not even all games would be fixable with gamescope.
    So until wayland has proper global hotkeys (Teamspeak, Keepass/Keeweb Autotyping) and a proper scaling mode for Xwayland windows, I have to keep a usable Xorg installation.
    Note: Unfortunately Xrandr can't apply scaling to the automatically created Xwayland0/Xwayland1 displays.
    If someone found a real working solution, please let us know. :)

    • @FlorianZier
      @FlorianZier Před 2 lety

      @Watcher Yeah thanks, I've seen that video too. Still currently a dealbreaker. :)
      As soon this is working and gamescope (or an alternative solution) can at least scale 50-75% of the applications correctly, I will try to switch again.

  • @timtheli0n
    @timtheli0n Před 4 měsíci

    For anyone wondering you can use scaling and still be able to move the mouse between monitors. You just need to to the scaling math when setting the position of the monitors to the right of the scaled monitors. So if your scale is 2 and your monitor is 1000 px wide rather than setting the position of the next monitor to +1000px set it to +500 to account for the scaling.

  • @SirWrexes
    @SirWrexes Před 2 lety

    You can set the position of a monitor from the terminal of you replace the comma with a whitespace !

  • @MrD0r1an
    @MrD0r1an Před 2 lety

    You can also use kanshi to setup multiple monitor layouts that are triggered automatically when plugging in.

  • @MichaelJGruber
    @MichaelJGruber Před 10 měsíci

    Way to go for sway :)
    In fact, I always found i3/xrandr to be simple and stable yet flexible enough. In the process of switching to sway, multi-monitor seems to be stable here, too. But UI is lacking somewhat (there is no easy positioning with `--left-of` etc, no shell completion for options) and - big surprise - no mirroring (cloning ) in sway at all. You can work around all of these (by doing your own scripting, resp. using `wl-mirror`) but I wish the initial user experience was better. I'll still switch, though this may keep others from doing so (and keeps me from advocating the switch).

  • @erikreider
    @erikreider Před 2 lety +3

    I'd recommend kanshi as a replacement for autorandr

  • @MrG0CE
    @MrG0CE Před 2 lety +1

    I USE BSPWM AND I'VE NEVER BEEN WORRIED ABOUT A 2ND DISPLAY, TIL LAST WEEK WHERE I NEED TO PLUG IT TO AN INFOCUS FOR A PRESENTATION AND THIS WAS HELL XD
    I'LL USE WAYLAND TIL BSPWM GET REWRITTEN FOR WAYLAND :P

  • @SnowyRVulpix
    @SnowyRVulpix Před 2 lety +2

    Never had an issue with multi monitor in xorg.

  • @gireeshmarathi2796
    @gireeshmarathi2796 Před 2 lety

    For position command you shouldn't give comma in terminal give a white space it will work

  • @skwinged
    @skwinged Před 2 měsíci

    On a slightly related note: is it possible to divide a monitor into multiple virtual monitors on Wayland just like you did on x11 back in the day using xrandr?

  • @hostgrady
    @hostgrady Před 2 lety +1

    good thumbnail

  • @programmingguy6081
    @programmingguy6081 Před rokem

    Is it Wayland or is it the compositor? You're just trading commands from X11 to sway. I don't know on X11 Arandr is pretty easy when arranging displays.

  • @jasondaigo
    @jasondaigo Před 2 lety +1

    I had a bunch of problems in wayland when not using every monitor during work hours. When the company pc using 2 of my 3 displays. And my Linux private pc use only 1. sway constantly mixed up the workspace assignment when switching around between 1 and 3 active screens. i3 and xorg works for years now like that. Sway also mixed up transform and panel position. Very confusing. wdisplay could at least give the configured commands printed on screen to copy it to config

  • @spicynoodle7419
    @spicynoodle7419 Před 2 lety +1

    Brodie Waylandson hooray

  • @M.4y
    @M.4y Před rokem +1

    Any way to mirror screen to other output device?

  • @chonkusdonkus
    @chonkusdonkus Před rokem

    I assume you could also just use wdisplays and then get their current settings with swaymsg -t get_outputs and put those settings into the config file

  • @htmixl
    @htmixl Před 2 lety

    I like your whiteboard.

  • @eyssewieringa2084
    @eyssewieringa2084 Před 2 lety +1

    How did you configure that vim so we'll? I'm assuming it's nvim, but I only know about colorschemes. How do I set those line indicators on the right and the suggestions?

    • @Ironpants57
      @Ironpants57 Před 2 lety

      You mean the row and column indication highlights?
      *CursorColumn* and *CursorLine* . Check Vim's help on it's highlight syntax, from there you can either make your own colorscheme or set a few things in your vimrc file.
      While in Vim and you're in Vim's normal mode, type this command:
      *:help highlight*

  • @aleclowry7654
    @aleclowry7654 Před rokem

    How would you handle multimonitor on a laptop? Where it defaults to a configuration for single monitor, but behaves differently when plugged into other outputs?

  • @quandaledinglegaming4218
    @quandaledinglegaming4218 Před 2 lety +4

    xorg better

  • @valentinegraev9350
    @valentinegraev9350 Před rokem

    thanks a lot. please tell me how can i launch some apps like steam in virtual monitor? i have 21:9 monitor, and want to use a sunshine - stream server to share to my tv. i create virtual monitor with resolution as my tv .everything works, but i can't lauch apps in my second virtual monitor

  • @diogenes_of_sinope
    @diogenes_of_sinope Před 2 lety

    12:22 I've always tried to understand what exactly are you saying after the "gaming channel", I even lowered down the speed to the maximum but still failed.

    • @Amplefii
      @Amplefii Před 2 lety +1

      its just his name BrodieRobertsonPlays

  • @CobaltSpace
    @CobaltSpace Před 2 lety

    You can use the name of the monitor in the sway config instead of the port. You just need to quote it.
    I use a space to separate x & y when using the position command and I don't get any problems.
    One of the biggest issues with swaymsg is the need for nested quoting.

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety

      That's my bad I mistyped the names when I tested it

    • @theDevPanda
      @theDevPanda Před rokem

      Using a variable for this makes it a lot easier.

  • @HowToLinux
    @HowToLinux Před 2 lety

    Do you still have issues with global shortcuts or does it work finally? If yes which librery do you use for it?

  • @doooofus
    @doooofus Před 2 lety

    not rly that related to the vid but one thing i think would be based for display managers (regardless of multimonitor support) would be some sorta usb gyro device you could hotglue to the back of your display to keep track of orientation, so you could have smartphone-like auto-rotate if you have one of those fancy monitor arms that lets you spin them round. thats what i have for my single monitor setup but if i could do something like this id probably consider expanding out and using it w a dual monitor setup tbh

  • @mishrav77
    @mishrav77 Před 2 lety +2

    hey brodie , y not use waybar ? it's more commonly used with Wayland window managers .

    • @chunkymunky4165
      @chunkymunky4165 Před 2 lety

      Is it compatible with i3, dmenu and gaps
      Edit: I meant comparable.

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety

      Haven't got around to testing it is all

    • @mishrav77
      @mishrav77 Před 2 lety

      @@BrodieRobertson oh ok makes sense . u should use / try it when u get a chance !

  • @dcxrobinson
    @dcxrobinson Před rokem

    now to get in the system is stuck at log in

  • @umka7536
    @umka7536 Před 2 lety

    Xrandr does the same and works perfectly.

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety

      Have you tried doing high refresh rate stuff on multiple monitors

    • @umka7536
      @umka7536 Před 2 lety

      @@BrodieRobertson I don't have high refresh rate monitors. Mine are 75Hz max.

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety

      @@umka7536 for stuff like that it's generally fine

  • @jadesprite
    @jadesprite Před 2 lety

    Can sway load custom EDIDs from file? I checked last january but still no wayland implementation could. I can't really move until that works.

    • @jadesprite
      @jadesprite Před 2 lety

      To answer my own question, it seems sway now has a way to create custom modelines; but it now also reads an EDID loaded from the kernel command line (the classic, drm.edid_firmware="DP-1:path/of/your/edid.bin") so this looks promising!

  • @jasondaigo
    @jasondaigo Před 2 lety

    I actually wanted to give sway another shot just now. But 30 minutes in, im starting to believe that there is no way of disabling mouse acceleration. That would already shut the door for me. edit: might be accel_profile "flat" , testing

    • @cynodont7391
      @cynodont7391 Před 2 lety

      Sway is using libinput so mouse acceleration is controlled by two parameters. The first is indeed accel_profile which can be set to either "flat" or "adaptive". The second option is pointer_accel that takes a floating point value between -1 (slowest) to 1 (fastest).
      When using swaymsg, you need to add escaped quotes to be able to pass a negative value.
      For example:
      swaymsg input 'type:pointer' accel_profile flat
      swaymsg input 'type:pointer' pointer_accel \'-0.6\'

  • @luandevecchi3862
    @luandevecchi3862 Před 2 lety

    Hey! do you still use the EOS M200 as your webcam?

  • @sel88q
    @sel88q Před 2 lety

    Can someone help me?
    A year ago Sway & wayland is working fine in my Arch machine, River & wayland too
    But current Sway & wayland, I cant input my keyboard, only Enter key & Spacebar key is working.
    I also tried Sway & River in Void Linux, but the problem still appear, my keyboard cant working.

  • @davidfisher5053
    @davidfisher5053 Před rokem

    A former coworker that REFUSED to acknowledge the productivity increases from having a second monitor.

  • @glennmatsiwe8705
    @glennmatsiwe8705 Před 2 lety

    so what is it

  • @dcxrobinson
    @dcxrobinson Před rokem

    it didn't work! ugh i guess i need a modeline

  • @Don_XII
    @Don_XII Před 2 lety

    there is no primary display? that's weird

    • @quandaledinglegaming4218
      @quandaledinglegaming4218 Před 2 lety

      yeah and it's impractical as hell as a former sway user

    • @Don_XII
      @Don_XII Před 2 lety

      @@quandaledinglegaming4218 that's weird, I know games don't usually run well under wayland but what did that cause annoyance to you?

  • @tld8102
    @tld8102 Před 2 lety

    this needs a gui

  • @fleurcode
    @fleurcode Před 2 lety

    I still need a fix for overscan in wayland, it's the 1 problem Wayland has

    • @groultaria6732
      @groultaria6732 Před 2 lety

      Along with wide-screen 144hz nvidia drivers handling

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety

      Are you using a TV? I've never seen it on a monitor but maybe I've just been lucky

    • @groultaria6732
      @groultaria6732 Před 2 lety

      @Watcher I'm working on it..

  • @dougtilaran3496
    @dougtilaran3496 Před 2 lety

    Get a Matrox card and call me in the morning. I've run them since 2000

  • @tohur
    @tohur Před 2 lety +1

    I have 4 monitors lol. I just don't see how anyone these days can do anything without having at least two monitors lol

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety +1

      I've used a laptop for a long time it's certainly workable but it's not desirable

    • @terrydaktyllus1320
      @terrydaktyllus1320 Před 2 lety

      I still use one monitor on each PC - but I have 6 PCs of various sizes sharing 3 screens in my upstairs study (via KVM switches) and another 3 PCs in my garage "man cave" sharing 3 screens with three Raspberry Pi 4's that are VESA mounted on the back of each screen too. And that's not counting the numerous (mostly Thinkpad) laptops that I have and the pile of "PCs that are too good to throw away" in the corner of my man cave too. All of them run (except the Pi's) Gentoo Linux too.
      Correct me if I am wrong but isn't the whole point of Xorg to have easy switching between desktop environments? I do have a long attention span and therefore don't need to be looking at several screens at one using the single pair of eyes that I have. If I am using i3 with 10 desktop screens to switch between instantaneously, why do I need more than one monitor?
      I guess having multiple screens can be something to impress your friends with, or you can pretend you're in the CDC and giving Jack Bauer instructions on where he needs to go next in an episode of "24".

    • @tohur
      @tohur Před 2 lety

      @@BrodieRobertson after I first started using two displays like 10 yrs ago its almost impossible for me to get much done on a laptop.. I have one but it doesn't get much use TBH.. have it running a few network stuff on my local network

    • @tohur
      @tohur Před 2 lety

      @@terrydaktyllus1320 try being a streamer or content creator with one monitor... not very fun and is in fact why over a decade ago I started using multiple monitors as I was twitch streaming back then

  • @ConnorOfDestruction
    @ConnorOfDestruction Před 2 lety +1

    1. install gnome
    2. enable gdm etc
    3. configure monitors from settings like a normal person
    4. ???
    5. profit

  • @itachi2011100
    @itachi2011100 Před 2 lety +1

    isn't all this super easy with xrandr, some things even more so. Arranging monitors in sensible ways doesn't even require using any numbers.
    Only God can help you if you're using randr.

  • @cynodont7391
    @cynodont7391 Před 2 lety

    The pos command failed because swaymsg interprets the comma as a command separator as indicated by the sway (5) man pages says «you may also run several commands in order by separating each with , or ; ».
    The solution is to quote the argument with some escape sequences to bypass the shell :
    swaymsg output eDP-1 pos \"1000,0\"

  • @winnie8614
    @winnie8614 Před 2 lety

    So if you plug wrong monitor (with less supporeted resolution) in same port you can burn it up? Great! Normal system should remeber config for exat device, not to port it's connected to.

    • @erikreider
      @erikreider Před 2 lety

      It wouldn't apply the settings to that monitor if I remember correctly

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety +3

      That's not how monitors have ever worked, if a setting isn't available it will drop to its default which is usually something like 1080p 60hz.

  • @zweitekonto9654
    @zweitekonto9654 Před 2 lety

    I thought arch linux users were alergic to easy and working out of the box stuff

    • @BrodieRobertson
      @BrodieRobertson  Před 2 lety

      Nah we just like pain but sometimes it's nice to have something easy