]> gitweb.fluxo.info Git - vbox.git/commitdiff
Adds clip action into kvmx
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Feb 2017 11:40:59 +0000 (09:40 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Feb 2017 11:40:59 +0000 (09:40 -0200)
kvmx

diff --git a/kvmx b/kvmx
index 36a84e268eb74f7312380425a35ca7b2ca4f3c23..410fece8f739af96ab4461bb88cac4955f879ef7 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -41,4 +41,16 @@ if [ "$ACTION" == "up" ]; then
 
   # Fix window titles
   xdotool search --name "SPICEc:0" set_window --name $VM
+elif [ "$ACTION" == "clip" ]; then
+  local instances="`ps -o pid,command -e | grep "spice-vdagent$" | cut -d ' ' -f 2 | xargs`"
+
+  # Kill old instances
+  for pid in $instances; do
+    kill -9 $pid &> /dev/null
+  done
+
+  # Just to make sure we're inside a virtual machine
+  if which spice-vdagent; then
+    spice-vdagent
+  fi
 fi