This commit is contained in:
Stephan Raabe
2023-10-04 17:05:17 +02:00
parent 2eb576c949
commit 37c255c7bf
5 changed files with 9 additions and 7 deletions

View File

@@ -15,19 +15,21 @@ if [ -f ~/private/win11-credentials.sh ]; then
else
win11user="USER"
win11pass="PASS"
vmip="192.168.122.44"
fi
tmp=$(virsh --connect qemu:///system list | grep " win11 " | awk '{ print $3}')
if ([ "x$tmp" == "x" ] || [ "x$tmp" != "xrunning" ])
then
virsh --connect qemu:///system start win11
echo "Virtual Machine win11 is starting... Waiting 45s for booting up."
notify-send "Virtual Machine win11 is starting..." "Waiting 45s for booting up."
sleep 45
notify-send "Virtual Machine win11 is starting..." "Waiting 30s for booting up."
sleep 30
else
notify-send "Virtual Machine win11 is already running." "Launching xfreerdp now!"
echo "Starting xfreerdp now..."
fi
xfreerdp -grab-keyboard /v:192.168.122.44 /size:100% /cert-ignore /u:$win11user /p:$win11pass /d: /dynamic-resolution /gfx-h264:avc444 +gfx-progressive &
xfreerdp -grab-keyboard /v:$vmip /size:100% /cert-ignore /u:$win11user /p:$win11pass /d: /dynamic-resolution /gfx-h264:avc444 +gfx-progressive &