diff options
-rwxr-xr-x | kvmx | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -1998,6 +1998,8 @@ function kvmx_shell { # Xrandr integration function kvmx_xrandr { + local size="$1" + if ! kvmx_running; then echo "$BASENAME: guest $VM is not running" exit 1 @@ -2009,13 +2011,20 @@ function kvmx_xrandr { fi if echo which xrandr | kvmx_ssh &> /dev/null; then - local mode="`xrandr | grep '*+' | awk '{ print $1 }' | tr 'x' ' '`" + # Check for resolution configuration or explicit param + if [ ! -z "$size" ]; then + mode="`echo $size | tr 'x' ' '`" + elif [ ! -z "$resolution" ]; then + mode="`echo $resolution | tr 'x' ' '`" + else + local mode="`xrandr | grep '*+' | awk '{ print $1 }' | tr 'x' ' '`" - if [ ! -z "$resolution_y_offset" ]; then - local x="`echo $mode | awk '{ print $1 }'`" - local y="`echo $mode | awk '{ print $2 }'`" + if [ ! -z "$resolution_y_offset" ]; then + local x="`echo $mode | awk '{ print $1 }'`" + local y="`echo $mode | awk '{ print $2 }'`" - mode="$x $(($y $resolution_y_offset))" + mode="$x $(($y $resolution_y_offset))" + fi fi if [ -z "$xrandr_device" ]; then |