Merge pull request #206 from KernelGhost/main

Updated README + Added checks for 'manual' flavor (#204)
This commit is contained in:
Rohan Barar 2024-08-09 17:28:17 +10:00 committed by GitHub
commit fa5f058e5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 24 deletions

View File

@ -277,7 +277,7 @@ If you already have a Windows VM or server you wish to use with WinApps, you wil
### Step 2: Clone WinApps Repository and Dependencies ### Step 2: Clone WinApps Repository and Dependencies
1. Clone the WinApps GitHub repository. 1. Clone the WinApps GitHub repository.
```bash ```bash
git clone https://github.com/winapps-org/winapps.git && cd winapps git clone --recurse-submodules --remote-submodules https://github.com/winapps-org/winapps.git && cd winapps
``` ```
2. Install the required dependencies. 2. Install the required dependencies.
@ -387,7 +387,7 @@ DEBUG="true"
# [AUTOMATICALLY PAUSE WINDOWS] # [AUTOMATICALLY PAUSE WINDOWS]
# NOTES: # NOTES:
# - This is currently INCOMPATIBLE with 'docker'. # - This is currently INCOMPATIBLE with 'docker' and 'manual'.
# - See https://github.com/dockur/windows/issues/674 # - See https://github.com/dockur/windows/issues/674
# DEFAULT VALUE: 'off' # DEFAULT VALUE: 'off'
# VALID VALUES: # VALID VALUES:

View File

@ -626,29 +626,32 @@ function waCheckIdle() {
local TIME_ELAPSED=0 local TIME_ELAPSED=0
local SUSPEND_WINDOWS=0 local SUSPEND_WINDOWS=0
# Check if there are no WinApps-related FreeRDP processes running. # Prevent 'autopause' functionality with unsupported Windows backends.
if ! ls "$APPDATA_PATH"/FreeRDP_Process_*.cproc &>/dev/null; then if [ "$WAFLAVOR" != "manual" ] && [ "$WAFLAVOR" != "docker" ]; then
SUSPEND_WINDOWS=1 # Check if there are no WinApps-related FreeRDP processes running.
while (( TIME_ELAPSED < AUTOPAUSE_TIME )); do if ! ls "$APPDATA_PATH"/FreeRDP_Process_*.cproc &>/dev/null; then
if ls "$APPDATA_PATH"/FreeRDP_Process_*.cproc &>/dev/null; then SUSPEND_WINDOWS=1
SUSPEND_WINDOWS=0 while (( TIME_ELAPSED < AUTOPAUSE_TIME )); do
break if ls "$APPDATA_PATH"/FreeRDP_Process_*.cproc &>/dev/null; then
fi SUSPEND_WINDOWS=0
sleep $TIME_INTERVAL break
TIME_ELAPSED=$((TIME_ELAPSED + TIME_INTERVAL)) fi
done sleep $TIME_INTERVAL
fi TIME_ELAPSED=$((TIME_ELAPSED + TIME_INTERVAL))
done
fi
# Hibernate/Pause Windows. # Hibernate/Pause Windows.
if [ "$SUSPEND_WINDOWS" -eq 1 ]; then if [ "$SUSPEND_WINDOWS" -eq 1 ]; then
dprint "IDLE FOR ${AUTOPAUSE_TIME} SECONDS. SUSPENDING WINDOWS." dprint "IDLE FOR ${AUTOPAUSE_TIME} SECONDS. SUSPENDING WINDOWS."
notify-send --expire-time=8000 --icon="info" --app-name="WinApps" --urgency="low" "WinApps" "Pausing Windows due to inactivity." notify-send --expire-time=8000 --icon="info" --app-name="WinApps" --urgency="low" "WinApps" "Pausing Windows due to inactivity."
if [ "$WAFLAVOR" = "docker" ]; then if [ "$WAFLAVOR" = "docker" ]; then
docker compose --file "$COMPOSE_PATH" pause &>/dev/null docker compose --file "$COMPOSE_PATH" pause &>/dev/null
elif [ "$WAFLAVOR" = "podman" ]; then elif [ "$WAFLAVOR" = "podman" ]; then
podman-compose --file "$COMPOSE_PATH" pause &>/dev/null podman-compose --file "$COMPOSE_PATH" pause &>/dev/null
elif [ "$WAFLAVOR" = "libvirt" ]; then elif [ "$WAFLAVOR" = "libvirt" ]; then
virsh suspend "$VM_NAME" &>/dev/null virsh suspend "$VM_NAME" &>/dev/null
fi
fi fi
fi fi
} }