Earlier quoted context omitted.
This is how I do it under Sway (Wayland): #!/bin/bash swaymsg create_output OUTPUT=$(swaymsg -r -t get_outputs | jq '.[].name' | grep HEADLESS | tr -d '"') # No need to reduce res, it defualts to 1080p #swaymsg output "$OUTPUT" resolution 1280x720 wl-mirror "$OUTPUT" swaymsg output "$OUTPUT" unplug When I was still in X11 land I used to just use Xephyr.
I just realized formatting is a bit broken. :( Fixed: #!/bin/bash swaymsg create_output OUTPUT=$(swaymsg -r -t get_outputs | jq '.[].name' | grep HEADLESS | tr -d '"') # No need to reduce res, it defualts to 1080p # swaymsg output "$OUTPUT" resolution 1280x720 wl-mirror "$OUTPUT" swaymsg output "$OUTPUT" unplug
#!/bin/bash
swaymsg create_output
OUTPUT=$(swaymsg -r -t get_outputs | jq '.[].name' | grep HEADLESS | tr -d '"')
# No need to reduce res, it defualts to 1080p
# swaymsg output "$OUTPUT" resolution 1280x720
wl-mirror "$OUTPUT"
swaymsg output "$OUTPUT" unplug