@@ -2243,6 +2243,12 @@ function start_viewer {
22432243 viewer_args+=(" ${viewer_uri} " )
22442244 fi
22452245
2246+ # Add extra arguments
2247+ if [ -n " ${viewer_extra_args} " ]; then
2248+ # shellcheck disable=SC2206
2249+ viewer_args+=(${viewer_extra_args} )
2250+ fi
2251+
22462252 # Launch the viewer
22472253 echo " - Viewer: ${viewer} ${viewer_args[*]} >/dev/null 2>&1 &"
22482254 " ${viewer} " " ${viewer_args[@]} " > /dev/null 2>&1 &
@@ -2308,6 +2314,7 @@ function usage() {
23082314 echo " --snapshot info : Show disk/snapshot info."
23092315 echo " --status-quo : Do not commit any changes to disk/snapshot."
23102316 echo " --viewer <viewer> : Choose an alternative SPICE viewer. @Options: 'spicy' (default), 'remote-viewer', 'none'"
2317+ echo " --viewer-extra-args <arguments> : Pass extra arguments to the SPICE viewer."
23112318 echo " --width <width> : Set VM screen width; requires '--height'"
23122319 echo " --height <height> : Set VM screen height; requires '--width'"
23132320 echo " --ssh-port <port> : Set SSH port manually"
@@ -2550,6 +2557,7 @@ secureboot="off"
25502557tpm=" off"
25512558usb_devices=()
25522559viewer=" ${viewer:- spicy} "
2560+ viewer_extra_args=" ${viewer_extra_args:- } "
25532561width=" ${width:- } "
25542562height=" ${height:- } "
25552563ssh_port=" ${ssh_port:- } "
@@ -2708,6 +2716,10 @@ else
27082716 SHORTCUT_OPTIONS+=" --viewer ${2} "
27092717 viewer=" ${2} "
27102718 shift 2;;
2719+ -viewer-extra-args|--viewer-extra-args)
2720+ SHORTCUT_OPTIONS+=" --viewer-extra-args ${2} "
2721+ viewer_extra_args=" ${2} "
2722+ shift 2;;
27112723 -width|--width)
27122724 SHORTCUT_OPTIONS+=" --width ${2} "
27132725 width=" ${2} "
0 commit comments