Skip to content

Commit b7d5d72

Browse files
authored
Mount zwift volume to different directory and rsync appdata (#370)
Workaround for #366
1 parent ea9da2e commit b7d5d72

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ ARG WINETRICKS_CHECKSUM=431f82fc74000e6c864409f1d8fb495d696c03928808e3e8acffc451
4242
# - libegl1 and libgl1 for GL library
4343
# - libvulkan1 for vulkan loader library
4444
# - procps for pgrep
45+
# - rsync to synchronize zwift volume with zwift appdata (WORKAROUND issue 366)
4546
# - wget for downloading winehq key
4647
# - winbind for ntml_auth required by zwift/wine
4748
# - xdg-utils seems to be a dependency of wayland
@@ -59,6 +60,7 @@ RUN dpkg --add-architecture i386 \
5960
libgamemodeauto0.i386 \
6061
libvulkan1 \
6162
procps \
63+
rsync \
6264
wget \
6365
winbind \
6466
xdg-utils \

src/run_zwift.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ readonly ZWIFT_NO_GAMEMODE="${ZWIFT_NO_GAMEMODE:-0}"
3030

3131
readonly WINE_USER_HOME="/home/user/.wine/drive_c/users/user"
3232
readonly ZWIFT_HOME="/home/user/.wine/drive_c/Program Files (x86)/Zwift"
33+
readonly ZWIFT_VOLUME="${WINE_USER_HOME}/AppData/Local/ZwiftVolume" # WORKAROUND issue 366 (remove when fixed)
3334
readonly ZWIFT_DOCS="${WINE_USER_HOME}/AppData/Local/Zwift"
3435
readonly ZWIFT_PREFS="${ZWIFT_DOCS}/prefs.xml"
3536

@@ -93,6 +94,16 @@ wait_until_wine_task_started() {
9394
wait_until "is_wine_task_running ${task_name}"
9495
}
9596

97+
#########################################################################################
98+
##### Sync Zwift volume to Zwift AppData - WORKAROUND issue 366 (remove when fixed) #####
99+
100+
msgbox info "Synchronizing Zwift settings"
101+
if rsync -au "${ZWIFT_VOLUME}/" "${ZWIFT_DOCS}/"; then
102+
msgbox ok "Synchronized Zwift settings"
103+
else
104+
msgbox warning "Failed to synchronize Zwift settings"
105+
fi
106+
96107
###########################
97108
##### Configure Zwift #####
98109

@@ -197,4 +208,12 @@ while is_wine_task_running ZwiftApp.exe; do
197208
sleep 5
198209
done
199210

211+
# WORKAROUND issue 366 (remove when fixed)
212+
msgbox info "Synchronizing Zwift settings"
213+
if rsync -au "${ZWIFT_DOCS}/" "${ZWIFT_VOLUME}/"; then
214+
msgbox ok "Synchronized Zwift settings"
215+
else
216+
msgbox warning "Failed to synchronize Zwift settings"
217+
fi
218+
200219
msgbox info "Zwift closed, exiting"

src/zwift.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ VERBOSITY="${VERBOSITY:-1}" # updated after loading user config files
1414
readonly USER_CONFIG_DIR="${HOME}/.config/zwift"
1515
readonly WINE_USER_HOME="/home/user/.wine/drive_c/users/user"
1616
readonly ZWIFT_HOME="/home/user/.wine/drive_c/Program Files (x86)/Zwift"
17-
readonly ZWIFT_DOCS="${WINE_USER_HOME}/AppData/Local/Zwift"
17+
readonly ZWIFT_DOCS="${WINE_USER_HOME}/AppData/Local/ZwiftVolume" # WORKAROUND issue 366 (change ZwiftVolume to Zwift when fixed)
1818

1919
if [[ -t 1 ]]; then
2020
readonly INTERACTIVE_TERMINAL="1"

0 commit comments

Comments
 (0)