Updated to 5.5.1+dfsg-14ubuntu3. It's not enough to prevent Plasma from crashing if I disconnect/reconnect both monitors simultaneously with my script.
#!/bin/sh
restore=`unxrandr`
outputs=`xrandr | grep -i "^\\w" | grep connected | cut -d' ' -f1`
alloff="xrandr"
for o in $outputs
do alloff="$alloff --output $o --off"
done
echo $alloff
echo $restore
$alloff
sleep 2
$restore
But at least applications tend to survive, and plasma restarts itself.
Updated to 5.5.1+dfsg- 14ubuntu3. It's not enough to prevent Plasma from crashing if I disconnect/ reconnect both monitors simultaneously with my script.
#!/bin/sh
alloff= "$alloff --output $o --off"
restore=`unxrandr`
outputs=`xrandr | grep -i "^\\w" | grep connected | cut -d' ' -f1`
alloff="xrandr"
for o in $outputs
do
done
echo $alloff
echo $restore
$alloff
sleep 2
$restore
But at least applications tend to survive, and plasma restarts itself.