Skip to content

Commit 92db980

Browse files
authored
Merge pull request #21 from Mr-MyDooM/fix/manual-mode-skip-menu
manual-mode-skip-menu
2 parents 9b3f6c5 + 946ad78 commit 92db980

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

WinApps-Launcher.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ function winapps_flavor_detection() {
8888
echo -e "${DEBUG_TEXT}> USING DEFAULT BACKEND '${WAFLAVOR}'${RESET_TEXT}"
8989
else
9090
# Check if a valid flavor was specified.
91-
if [[ "$WAFLAVOR" != "docker" && "$WAFLAVOR" != "podman" && "$WAFLAVOR" != "libvirt" ]]; then
91+
if [[ "$WAFLAVOR" != "docker" && "$WAFLAVOR" != "podman" && "$WAFLAVOR" != "libvirt" && "$WAFLAVOR" != "manual" ]]; then
9292
# Throw an error.
93-
show_error_message "ERROR: Specified WinApps backend '${WAFLAVOR}' <u>INVALID</u>.\nPlease ensure 'WAFLAVOR' is set to \"docker\", \"podman\" or \"libvirt\" within <i>${CONFIG_FILE}</i>."
93+
show_error_message "ERROR: Specified WinApps backend '${WAFLAVOR}' <u>INVALID</u>.\nPlease ensure 'WAFLAVOR' is set to \"docker\", \"podman\", \"libvirt\", or \"manual\" within <i>${CONFIG_FILE}</i>."
9494
exit "$EC_BAD_BACKEND"
9595
fi
9696
fi
@@ -326,6 +326,17 @@ export -f check_reachable
326326
function generate_menu() {
327327
local STATE=""
328328

329+
330+
if [[ "$WAFLAVOR" == "manual" ]]; then
331+
echo -e "${DEBUG_TEXT}> SKIPPING VM CONTROL IN 'manual' MODE${RESET_TEXT}"
332+
echo "menu:\
333+
${MENU_APPLICATIONS}|\
334+
${MENU_REDMOND}|\
335+
${MENU_KILL}|\
336+
${MENU_REFRESH}|\
337+
${MENU_QUIT}" >&3
338+
return
339+
fi
329340
# Check Windows State
330341
if [[ "$WAFLAVOR" == "libvirt" ]]; then
331342
# Possible values are 'running', 'paused' and 'shut off'.
@@ -412,6 +423,11 @@ export -f generate_menu
412423

413424
# Start Windows
414425
function start_windows() {
426+
427+
if [[ "$WAFLAVOR" == "manual" ]]; then
428+
echo -e "${DEBUG_TEXT}> SKIPPING VM CONTROL IN 'manual' MODE${RESET_TEXT}"
429+
return
430+
fi
415431
# Issue Command
416432
if [[ "$WAFLAVOR" == "libvirt" ]]; then
417433
virsh start "$VM_NAME" &>/dev/null &

0 commit comments

Comments
 (0)