| resources | Initial commit | |
| src | fix: launching without steam and hdr flags | |
| .gitignore | Initial commit | |
| Cargo.lock | Initial commit | |
| Cargo.toml | Initial commit | |
| LICENSE | Initial commit | |
| README.md | Fix readme command | |
Local splitscreen multiplayer via isolated namespaces
What?
Couch coop is dead.. or at least way too many games release without any sort of couch coop support, but online-multiplayer. Sigh
Maybe I am just getting old, but I like to talk to and see my friends, while we play together and no I don't mean via Discord.
So this little tool spawns multiple small sandboxed programs and splits the screen up so each player gets a similarily sized portion of the screen.
(Up to 4 currently! PRs to increase that are welcome.)
How?
Linux sandboxing is great. You can just create new home directories and use the hosts root file system otherwise. Oh and simulate gamepads, so we can direct them to the different instances.
Most of the code used here was shamlessly copied from magic-mirror by Colin Marc. (See copyright of each individual source file.)
Usage?
e.g. local-magic --width 3840 --height 2160 --refresh 120 --count 2 --command "steam -bigpicture"
Limitations
- Currently this tool requires and uses gamescope to create virtual outputs matching the different split-screen areas. As such you need to manually position them.
- This tool can't make your multiple mice and keyboards go to different windows. You need a compositor with multi-seat support like sway to attempt that.
- The gamepads are emulated through southpaw. While that works nicely
for controller that might be connected later or re-connected at some point, this poses some very specific limitations as well:
- On some controllers keys might be swapped (e.g. X and Y)
- Steam will not pick up your controller. Use the mouse to launch the games.
- Anything using
/dev/uinputwon't work, most annoyingly Steam Input needs to be disabled.
- This currently creates fresh (but persistent) home directories for each instance.
This means you might need to re-download games you already have locally. The home directories
are in
$XDG_DATA_HOME/local-magic/$i. Feel free to use a file system with ref-links to copy in your steam library or something like overlay fs. Don't share you steam folder with multiple running instances!