* Inotify action for watching a folder in the host and issuing commands in the
guest upon change.
- * Notification on Awesome VM when a Spice session is triggered.
+ * Notification on Awesome VM when a Spice session taking too long to open.
## 0.2.0 - 2024-07-02
exit 1
fi
- # UX
- if which awesome-client &> /dev/null; then
- echo "naughty.notify({title = \"KVMX:\", text =\"Starting GUI session for $VM\", timeout = 2})" | awesome-client
- fi
-
local spicestring
if [ "$spice_client" == "spicy" ] && which spicy &> /dev/null; then
local spicewait="0"
local windowid
local windowpid
+ local notify="0"
# Wait for the spice window to show up. This might take a while and we'll
# wait only a few times
- while (( $spicewait <= 5 )); do
- # Wait a bit
- sleep 2
- let spicewait++
-
+ while (( $spicewait <= 10 )); do
windowid="`xdotool search --name "$spicestring" 2> /dev/null`"
if [ ! -z "$windowid" ]; then
windowpid=""
fi
fi
+
+ # It's waiting too long, notify the user
+ if which awesome-client &> /dev/null && [ "$notify" == "0" ]; then
+ notify="1"
+
+ echo "naughty.notify({title = \"KVMX:\", text =\"Starting GUI session for $VM\", timeout = 2})" | awesome-client
+ fi
+
+ # Wait a bit and try again
+ sleep 1
+ let spicewait++
done
# Set window position