From d7732f923f458dfeaca9d4863434389b0641f716 Mon Sep 17 00:00:00 2001 From: Traktuner <78533119+traktuner@users.noreply.github.com> Date: Mon, 12 Feb 2024 20:42:31 +0100 Subject: [PATCH 1/3] add virtual desktop mode as default --- CHANGELOG.md | 1 + Dockerfile.ubuntu18 | 1 + Dockerfile.ubuntu20 | 1 + Dockerfile.ubuntu22 | 1 + README.md | 1 + startapp.sh | 80 ++++++++++++++++++++++++++------------------- 6 files changed, 51 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ff632..865fcfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Automatically create symlinks for mounts (#110, thanks @xela1) +- Enable Wine Virtual Desktop mode by default ### Changed - Updated known-good Backblaze version to 9.0.1.763 diff --git a/Dockerfile.ubuntu18 b/Dockerfile.ubuntu18 index 334e528..1b68db8 100644 --- a/Dockerfile.ubuntu18 +++ b/Dockerfile.ubuntu18 @@ -28,6 +28,7 @@ ENV LANG en_US.UTF-8 ENV APP_NAME="Backblaze Personal Backup" ENV FORCE_LATEST_UPDATE="false" ENV DISABLE_AUTOUPDATE="false" +ENV DISABLE_VIRTUAL_DESKTOP="false" # Disable WINE Debug messages ENV WINEDEBUG -all diff --git a/Dockerfile.ubuntu20 b/Dockerfile.ubuntu20 index def79c5..9f17146 100644 --- a/Dockerfile.ubuntu20 +++ b/Dockerfile.ubuntu20 @@ -28,6 +28,7 @@ ENV LANG en_US.UTF-8 ENV APP_NAME="Backblaze Personal Backup" ENV FORCE_LATEST_UPDATE="false" ENV DISABLE_AUTOUPDATE="false" +ENV DISABLE_VIRTUAL_DESKTOP="false" # Disable WINE Debug messages ENV WINEDEBUG -all diff --git a/Dockerfile.ubuntu22 b/Dockerfile.ubuntu22 index cb31222..5254f97 100644 --- a/Dockerfile.ubuntu22 +++ b/Dockerfile.ubuntu22 @@ -28,6 +28,7 @@ ENV LANG en_US.UTF-8 ENV APP_NAME="Backblaze Personal Backup" ENV FORCE_LATEST_UPDATE="false" ENV DISABLE_AUTOUPDATE="false" +ENV DISABLE_VIRTUAL_DESKTOP="false" # Disable WINE Debug messages ENV WINEDEBUG -all diff --git a/README.md b/README.md index f601fb3..3f932c4 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ Environment variables can be set by adding one or more arguments `-e "=> "$log_file" +} + +# Pre-initialize Wine +if [ ! -f "${WINEPREFIX}system.reg" ]; then + echo "WINE: Wine not initialized, initializing" + wineboot -i + log_message "WINE: Initialization done" +fi + +#Configure Extra Mounts +for x in {d..z} +do + if test -d "/drive_${x}" && ! test -d "${WINEPREFIX}dosdevices/${x}:"; then + log_message "DRIVE: drive_${x} found but not mounted, mounting..." + ln -s "/drive_${x}/" "${WINEPREFIX}dosdevices/${x}:" + fi +done + +# Set Virtual Desktop +cd $WINEPREFIX +if [ "$DISABLE_VIRTUAL_DESKTOP" = "true" ]; then + winetricks vd=off + log_message "WINE: Virtual Desktop mode disabled" +else + # Check if with and height are defined + if [ -n "$DISPLAY_WIDTH" ] && [ -n "$DISPLAY_HEIGHT" ]; then + log_message "WINE: Enabling Virtual Desktop mode with $DISPLAY_WIDTH:$DISPLAY_WIDTH aspect ratio" + winetricks vd="$DISPLAY_WIDTH"x"$DISPLAY_HEIGHT" + else + # Default aspect ratio + log_message "WINE: Enable Virtual Desktop mode with recommended aspect ratio" + winetricks vd="900x700" + fi +fi # Disclaimer -disclaimer_updatemode() { # Check if auto-updates are disabled - if [ "$DISABLE_AUTOUPDATE" = "true" ]; then - echo "Auto-updates are disabled. Backblaze won't be updated." +if [ "$DISABLE_AUTOUPDATE" = "true" ]; then + echo "Auto-updates are disabled. Backblaze won't be updated." +else + # Check the status of FORCE_LATEST_UPDATE + if [ "$FORCE_LATEST_UPDATE" = "true" ]; then + echo "FORCE_LATEST_UPDATE is enabled which may brick your installation." else - # Check the status of FORCE_LATEST_UPDATE - if [ "$FORCE_LATEST_UPDATE" = "true" ]; then - echo "FORCE_LATEST_UPDATE is enabled which may brick your installation." - else - echo "FORCE_LATEST_UPDATE is disabled. Using known-good version of Backblaze." - fi + echo "FORCE_LATEST_UPDATE is disabled. Using known-good version of Backblaze." fi -} - -disclaimer_updatemode +fi -log_message() { - echo "$(date): $1" >> "$log_file" -} # Function to handle errors handle_error() { echo "Error: $1" >> "$log_file" @@ -62,24 +92,6 @@ start_app() { sleep infinity } -# Pre-initialize Wine -if [ ! -f "${WINEPREFIX}system.reg" ]; then - echo "WINE: Wine not initialized, initializing" - wineboot -i - log_message "WINE: Initialization done" -fi - -#Configure Extra Mounts - -for x in {d..z} -do - if test -d "/drive_${x}" && ! test -d "${WINEPREFIX}dosdevices/${x}:"; then - log_message "DRIVE: drive_${x} found but not mounted, mounting..." - ln -s "/drive_${x}/" "${WINEPREFIX}dosdevices/${x}:" - fi -done - - if [ -f "${WINEPREFIX}drive_c/Program Files (x86)/Backblaze/bzbui.exe" ]; then check_url_validity() { url="$1" From e9e0a6348639504728833f6692c76bfd9ae765b8 Mon Sep 17 00:00:00 2001 From: Traktuner <78533119+traktuner@users.noreply.github.com> Date: Mon, 12 Feb 2024 20:52:24 +0100 Subject: [PATCH 2/3] update readme with new resolution and virtual desktop infos --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3f932c4..5d972e5 100644 --- a/README.md +++ b/README.md @@ -112,8 +112,8 @@ Environment variables can be set by adding one or more arguments `-e "= Date: Tue, 13 Feb 2024 06:02:35 +0100 Subject: [PATCH 3/3] fix typo and wording --- startapp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/startapp.sh b/startapp.sh index 86f04a2..10a58d5 100644 --- a/startapp.sh +++ b/startapp.sh @@ -39,16 +39,16 @@ done # Set Virtual Desktop cd $WINEPREFIX if [ "$DISABLE_VIRTUAL_DESKTOP" = "true" ]; then + log_message "WINE: DISABLE_VIRTUAL_DESKTOP=true - Virtual Desktop mode will be disabled" winetricks vd=off - log_message "WINE: Virtual Desktop mode disabled" else - # Check if with and height are defined + # Check if width and height are defined if [ -n "$DISPLAY_WIDTH" ] && [ -n "$DISPLAY_HEIGHT" ]; then log_message "WINE: Enabling Virtual Desktop mode with $DISPLAY_WIDTH:$DISPLAY_WIDTH aspect ratio" winetricks vd="$DISPLAY_WIDTH"x"$DISPLAY_HEIGHT" else # Default aspect ratio - log_message "WINE: Enable Virtual Desktop mode with recommended aspect ratio" + log_message "WINE: Enabling Virtual Desktop mode with recommended aspect ratio" winetricks vd="900x700" fi fi