From c776901a8415cf350e1886fd83309add3a0ad4d4 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 17 Feb 2017 09:40:59 -0200 Subject: Adds clip action into kvmx --- kvmx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kvmx b/kvmx index 36a84e2..410fece 100755 --- 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 -- cgit v1.2.3