Simply put, is there an inverse to the following command?:xrandr --output VIRTUAL1 --offThis command cuts off my virtual display output to my external monitor, but I would like to reinitialize my virtual display output as well. DETAILS:I am using the solution to configuring external monitor on Nvidia Optimus machines here.I am having trouble moving between single (laptop) display and extended monitors using xrandr. I use the following script to move to a single monitor setup:xorg_process=$(ps aux | grep 'Xorg' | grep -v grep | awk '{print $2}')sudo kill -15 $xorg_processsudo rmmod nvidiasudo tee /proc/acpi/bbswitch <<<OFFxrandr --output VIRTUAL1 --offand moving back to external monitors (without rebooting), I use this script:sudo tee /proc/acpi/bbswitch <<<ONsudo modprobe bbswitchoptirun trueintel-virtual-outputxrandrYet I get the following error at optirun true:[16929.676769] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) Server terminated successfully (0). Closing log file.[16929.676811] [ERROR]Aborting because fallback start is disabled.If I remove the line xrandr --output VIRTUAL1 --off in the first script, then I am able to execute both scripts to switch back and forth between two and one monitor setups without error, except that the one monitor setup still 'sees' the external monitor without displaying it. So, I need xrandr --output VIRTUAL1 --off to cut off the virtual display, but I also need to reinitialize it as well. Is there a way to undo the command xrandr --output VIRTUAL1 --off when moving back to external monitor setup?
Switching on virtual display outputs using xrandr
xorg;xrandr