#!/bin/bash # # This script moves the mouse curser in order to inhibit screen lock and other power management features # # # endless loop while [ 1 ]; do # wait 5 minutes sleep 300; # state of VM state=$(virsh --connect qemu:///system dominfo Windows_10_Pro_Gaming | grep State) # if state contains "running" -> it is running if [[ "$state" = *"running"* ]]; then # Test if idle for more than 5 minutes (xprintidle provides ms) if [ "$(xprintidle)" -gt 300000 ]; then # move mouse xdotool mousemove 50 50; fi; fi; done;