5 ms·
Linux users probably already have some weird workflow with X11 virtual buffers to do this.
by neallindsay 2y ago
Linux users probably already have some weird workflow with X11 virtual buffers to do this.
- jauntywundrkind 2y agoYeah. On Wlroots or Sway, we can setup virtual displays pretty easily (swaymsg create_output, done). Run wayvnc, and both the other person and yourself connect over vnc or rdp to see what's over there. Available May 2020, https://github.com/any1/wayvnc/issues/7#issuecomment-625661109 https://github.com/any1/wayvnc/issues/7#issuecomment-6256611...
- moritzruth 2y agoFor Hyprland, the command is `hyprctl output create headless NAME`
- Devorlon 2y agoIt's not exactly the same, but as an alternative to what jauntywundrkind you can use V4L2-Loopback and OBS to create a virtual webcam and use that to share your screen. I find it really handy being able to switch between either just my cam, my desktop or both.
- marcodiego 2y agoXnest is probably enough. I've used it for similar purposes a few times. Don't know the equivalent for Wayland though.
- Arnavion 2y agoYes, Wayland compositors like cage and sway can be nested too. That said, with both the X nesting approach and the Wayland nesting approach, you'd also need to run the screencasting application itself inside the nested server, not the just the application you want to cast. If the compositor supports a way to create headless outputs (as sway and hyprland do) that is much easier.
- eqvinox 2y agoXnest got replaced by Xephyr AFAIK. But same thing at the end of the day.
- tasn 2y agoThis 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.
- arjvik 2y agoOoh, creating a headless display and then wl-mirroring it is incredibly smart! Have been looking for something like this!
- tasn 2y agoI 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
- craftkiller 2y agoYou can do code blocks on HN by prefixing your lines with four spaces. #!/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
- deleted 2y ago[deleted]
- mmh0000 2y agoFour spaces!? Absurd! Think of how many bytes you're wasting! In just your last code block your flooded the internet with 28 needless bytes!?!?!?!! If this keeps up soon we'll all just be downloading whitespace. Only two spaces are needed: https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc function trim { sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' } /end sarcasm
- pepve 2y agoI use `xrandr --setmonitor` to create a fake monitor that only covers part of my screen. And I have some window manager setup to easily move my windows there (with awesomewm).
- kristopolous 2y agoThat's a good solution. I used xnest
- craftkiller 2y agoPersonally I don't bother with a virtual display. I automatically set my display scale to 2x when I start screen sharing. I set that up with exec_before and exec_after hooks in xdg-desktop-portal-wlr[0]. In addition to turning off my notification daemon (so my email/instant message notifications don't pop up), my exec_before/exec_after scripts just run: swaymsg output "MY-MONITOR" scale 2 # or 1 for exec_after With that, everything puffs up big and readable when I'm screensharing and seamlessly shrinks back down when I stop screen sharing. No need to juggle windows around to different displays. [0] https://man.archlinux.org/man/extra/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr.5.en https://man.archlinux.org/man/extra/xdg-desktop-portal-wlr/x...
- jeroenhd 2y agoAs a Linux user who generally prefers to avoid the command line for things user friendly applications should be able to do, I'll stick with OBS. That solution also works on Windows, which is extra nice.