]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Run kvmx_xrandr and kvmx-vdagent at kvmx_spice only if spice action was called
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 20 Apr 2018 21:42:16 +0000 (18:42 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 20 Apr 2018 21:42:16 +0000 (18:42 -0300)
kvmx

diff --git a/kvmx b/kvmx
index e98921dc1c06f8f8d4112d2ed69c68d6c0003d4e..6fea6373b7557570d2df13d6202a194dec78ab40 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -249,14 +249,16 @@ function kvmx_spice {
     xdotool search --name "SPICEc:0" set_window --name $VM
   fi
 
-  # Set screen resolution
-  if [ "$xrandr" == "1" ]; then
-    kvmx_xrandr
-  fi
+  if [ "$ACTION" == "spice" ]; then
+    # Set screen resolution
+    if [ "$xrandr" == "1" ]; then
+      kvmx_xrandr
+    fi
 
-  # Restart vdagent
-  if [ "$ssh_support" == "y" ]; then
-    echo "which kvmx-vdagent > /dev/null && DISPLAY=:0 kvmx-vdagent" | kvmx_ssh
+    # Restart vdagent
+    if [ "$ssh_support" == "y" ]; then
+      echo "which kvmx-vdagent > /dev/null && DISPLAY=:0 kvmx-vdagent" | kvmx_ssh
+    fi
   fi
 }