#!/bin/sh # Boot or resume develacc and open a VNC viewer. Suspend develacc, # mainly to save battery power, when the viewer is closed. # # This is mainly for when I want to work in develacc for a while, full # screen, almost as if my laptop was running sid. # # For work where I expect to be going back and forth between the VM # and the bare metal host or other VMs, it might be better to access # the VM via a normal, non-fullscreened virt-manager window rather # than full screen virt-viewer. Similarly if I have a large monitor # available, it might be more convenient not to have the VM viewer # fullscreened set -e . $HOME/.shenv VIRSH="virsh --connect qemu:///system" develacc="develacc.$(hostname -f)" if wmctrl -l | grep -q "$develacc"; then wmctrl -a "$develacc" else if $VIRSH list | grep -q "$develacc .*paused"; then $VIRSH resume $develacc elif ! $VIRSH list | grep -q $develacc; then $VIRSH start $develacc fi virt-viewer -c qemu:///system --hotkeys=release-cursor=ctrl+alt \ -a -f -r $develacc # \ # && $VIRSH suspend $develacc & until wmctrl -l | grep -q "$develacc"; do sleep 0.3 done i3-fresh-workspace --take-along fi