itsmikethetech / Virtual-Display-Driver

Add virtual monitors to your windows 10/11 device! Works with VR, OBS, Sunshine, and/or any desktop sharing software.
3.01k stars 125 forks source link

could the virtual display start from cmd? #20

Closed zh2250635 closed 6 months ago

zh2250635 commented 9 months ago

I want to stream and play games through the Sunshine project, and I hope that the virtual screen is only activated when I am playing games.

HerringTheCoder commented 8 months ago

Maybe you could do something like this? Before stream initialization:

get-pnpdevice -class Display -FriendlyName 'IddSampleDriver Device HDR' | enable-pnpdevice

After the stream ends:

get-pnpdevice -class Display -FriendlyName 'IddSampleDriver Device HDR' | disable-pnpdevice

You can also set display configuration programatically (similar to Windows+P controls).

Not sure if you can use powershell commands with Sunshine scripts feature though, but I'll test it in the following days.

itsmikethetech commented 6 months ago

We have merged a script to enable/disable the driver: Script