wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Stream fake monitor ?

Open Nosirus opened this issue 2 years ago • 4 comments

Hi,

I couldn't find the info but, can we create a fake monitor?

I use sunshine to stream on my tablet but my screen has a resolution of 2560x1080 21:9 and my tablet 1600x2176 4:3 Creating a fake monitor might be the idea, but I don't know how to do it

If you have another idea I take it too :)

Nosirus avatar Feb 22 '23 20:02 Nosirus

You can have wayfire create a headless output by setting something like WLR_BACKENDS=libinput,drm,headless before starting wayfire. You probably have to configure it in settings too. Drop something like this in wayfire.ini:

[input-device:wlr_virtual_pointer_v1]
output = HEADLESS-1

[output:HEADLESS-1]
mode = 1280x1024
position = 4160, 0
scale = 1.000000
transform = normal

soreau avatar Feb 22 '23 21:02 soreau

I just tried quickly, the mode is not compatible and wayfire does not start.

But the logs talk about a custom mode I'll look tomorrow if it's a track

Nosirus avatar Feb 22 '23 21:02 Nosirus

You might have a look at this issue. I think the order of the backends matter, for one.

soreau avatar Feb 22 '23 21:02 soreau

Unfortunately, after many attempts I have errors

if i add WLR_BACKENDS=headless Couldn't find matching mode 1600x2176@60 for output HEADLESS-1. Trying to use custom mode

or if i add WLR_BACKENDS=libinput,drm,headless Could not add backend: multiple renderers at the same time aren't supported failled to add backend 'headless'

i have nixos as distro

Nosirus avatar Feb 27 '23 11:02 Nosirus

Here is a small python script I hacked together for my personal use, allowing me to use my laptop as my wireless second display in a local network:

import wayfire_socket as ws
import os
import signal

addr = os.getenv('WAYFIRE_SOCKET')
sock = ws.WayfireSocket(addr)

info = sock.create_headless_output(1920, 1080)['output']
sock.set_option_values({
    'output:HDMI-A-1/position' : '1920,0',
    f'output:{info["name"]}/position' : '0,0',
    f'output:{info["name"]}/mode' : '1920x1080',
})

# Wait for keyboard interrupt

def shutdown(a, b):
    del a, b
    print("Shutting down...")
    sock.destroy_headless_output(output_id=info['id'])
    sock.set_option_values({'output:HDMI-A-1/position' : '0,0'})

for signum in [signal.SIGINT, signal.SIGTERM, signal.SIGHUP]:
    signal.signal(signum, shutdown)


os.system("wayvnc -v 127.0.0.1 5678")

ammen99 avatar Apr 15 '24 10:04 ammen99