3

I'm trying to simulate the behavior of universal split screen, which is for Windows only on Linux (Fedora, preferably Gnome/XOrg) I found a lot about xrandr, Xephyr and xinerama, but while all tutorials I found sound a lot like what I need, I didn't manage to "just" run two instances of an application (Terraria in my case) in one window, side by side.

The closest I found was

Xephyr -br -ac -noreset -screen 1920x600 :1 &
Xephyr -br -ac -noreset -screen 1920x600 :2 &
DISPLAY=:1 <command> &
DISPLAY=:2 <command> &

.. which is at least hard to use because you have two separate windows with their decorations.

Is there a way (without installing a tiling window manager, which would be my next approach) to "run applications in one window which contains the output of different virtual displays in a static pre-defined manner"?

Or put less technical: is there a way to run applications which do not support 'side-by-side' operation in a side-by-side manner anyway on Linux? Like with Nucleus, universal split screen or tModLoader - Split Screen (which somehow does not work for me)

frans
  • 1,169

1 Answers1

1

Here's an example repository for a script that was meant to behave like universal split screen or Nucleus. It uses tools like firejail (for handling inputs for each instance) and nested weston sessions (for window separation and it supports hardware acceleration unlike Xephyr) and zenity for ui+handling game windows. Currently it only supports game controllers and 2 players:

https://github.com/AhmedKJ/Co-op-on-Linux

# Example :
./Co-Op-On-linux.sh --quickrun 1280x720 /home/user/game/thegame

Even if it's not exactly what you're looking for, it should be a good starting point for building your own. The basic idea is you need at least:

  • Something to handle window sizing/positioning/compositing, like Zephyr or Weston
  • Something like firejail to grab P1/P2 inputs and redirect them to either window. X11 will generally direct all input to the focused window otherwise.
  • And software/games that support running multiple instances, with regards to DRM/anti-cheat/file access
Cpt.Whale
  • 10,914