diff --git a/setup/linux/profile/airootfs/etc/skel/.update_x b/setup/linux/profile/airootfs/etc/skel/.update_x index 95eb986f..a34fec11 100755 --- a/setup/linux/profile/airootfs/etc/skel/.update_x +++ b/setup/linux/profile/airootfs/etc/skel/.update_x @@ -2,8 +2,17 @@ # ## Calculate DPI, update settings if necessary, then start desktop apps +MONITOR=$(xrandr --listmonitors | grep -E '^\s+[0-9]' | head -1 | sed -r 's/^.*\s+(.*)$/\1/') REGEX_XRANDR='^.* ([0-9]+)x([0-9]+)\+[0-9]+\+[0-9]+.* ([0-9]+)mm x ([0-9]+)mm.*$' +# Resize screen in VMs +if lsmod | grep -Eq 'qxl|virtio_gpu'; then + echo -n "Starting VM guest services..." + spice-vdagent + sleep 0.5 + xrandr --output "${MONITOR}" --auto +fi + echo -n "Getting display details... " # Get screen data diff --git a/setup/linux/profile/airootfs/etc/skel/.zlogin b/setup/linux/profile/airootfs/etc/skel/.zlogin index 8ecba0a8..b91b220c 100644 --- a/setup/linux/profile/airootfs/etc/skel/.zlogin +++ b/setup/linux/profile/airootfs/etc/skel/.zlogin @@ -1,5 +1,10 @@ setterm -blank 0 -powerdown 0 2>/dev/null if [ "$(fgconsole 2>/dev/null)" -eq "1" ]; then + # VM guest init + if lsmod | grep -Eq 'qxl|virtio_gpu'; then + systemctl start spice-vdagentd.service + fi + # Set up teststation details $HOME/.setup_teststation