1

Is there a way to start virt-viewer -f domain in DWM or i3 so it automatically fills all (2 of) my monitors as it does in gnome?

When I try now virt-viewer open both screens on 1 monitor on top of each other. If anyone knows a good hack/work around it would also be appreciated.

0

Okay if anybody sees this I managed to find a workaround. It is not pretty and won't work in all setups, but it worked for me in DWM. I added this to the bottom of my xinitrc file:

exec dwm&
virt-viewer -c qemu:///system windows10&
WIDS=””
arr=()

while [  ${#arr[@]} -lt 2]; do
    WIDS=`xdotool search “Virt Viewer” 2>/dev/null | sort -n `
    arr=()

    for id in $WIDS; do
            arr+=($id)
    done 
    sleep 0.2
done

screensConnected=`xrandr | grep -w ‘connected’ | wc -l`

if [ $screensConnected = 1 ]; then
    xdotool mousemove –window ${arr[1]} –sync 60 15
    xdotool click 1
    xdotool mousemove –window ${arr[1]} –sync 60 15
sleep 1
    xdotool mousemove –window ${arr[1]} –sync 60 15
    xdotool click 1
    sleep 1
    xdotool mousemove –window ${arr[1]} –sync 60 15
    sleep 1
    xdotool key F11
else
    xdotool mousemove –window ${arr[1]} –sync 1 1
    xdotool key shift+alt+comma
    sleep 1
xdotool mousemove –window ${arr[1]} –sync 1 1
    xdotool key F11
    sleep 1
    xdotool mousemove –window ${arr[1]} –sync 1 1
    xdotool key F11
fi

exec st

What it does is basically connecting to an already going KVM (windows10) moving the mouse to one screen, so it opens there, making that full screen, moving the mouse to the other screen so the second display will open there and then making that fullscreen.

You might have to tweak the timings and insert more sleep. If somebody comes with a better answer I will give them the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.