[Desktop Entry]
Encoding=UTF-8
Icon=virtualbox
Type=Application
Name=Wait Virtual Machines stop and shutdown
Comment=Wait until all Virtual Machines stopped and then request System Shutdown
Exec=/bin/bash -c 'sleep 30; [ "$(sleep 3; VBoxManage list runningvms | wc -l)" -gt 0 ] && { while [ "$(VBoxManage list runningvms | wc -l)" -gt 0 ]; do { sleep 1; }; done; [ "$(VBoxManage list runningvms | wc -l)" -eq 0 ] && { { for i in $(seq 0 4 100); do echo $i; sleep 3; done; } | zenity --title "vbox-wait-shutdown: Request System ShutDown…" --progress --time-remaining --auto-close --text "All Virtual Machines are stopped.\n\n<big><big>Do you want to Shutdown System now?</big></big>…\n\nPress Cancel to terminate or wait to Continue.\n" && fly-wmfunc FLYWM_SHUTDOWN; }; };'
StartupNotify=false
OnlyShowIn=Fly;
Terminal=false
Hidden=false
