Skip to content

Commit

Permalink
added fg flag
Browse files Browse the repository at this point in the history
  • Loading branch information
netbrain committed Oct 7, 2024
1 parent fd2cff7 commit a53d2d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ If dbus is available through a unix socket, the screensaver will be inhibited ev
| ZWIFT_USERNAME | | If set, try to login to zwift automatically |
| ZWIFT_PASSWORD | | " |
| ZWIFT_WORKOUT_DIR | | Set the workouts directory location |
| ZWIFT_FG | | If set, run the process in fg (-it) instead of bg (-d) |
| WINE_EXPERIMENTAL_WAYLAND| | If set, try to use experimental wayland support in wine 9 |
| NETWORKING | bridge | Sets the type of container networking to use. |
| ZWIFT_UID | current users id | Sets the UID that Zwift will run as (docker only) |
Expand Down
10 changes: 9 additions & 1 deletion zwift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ fi

# Define Base Container Parameters
GENERAL_FLAGS=(
-d
--rm
--privileged
--network $NETWORKING
Expand Down Expand Up @@ -204,6 +203,14 @@ then
fi
fi

# Setup foreground/background flag
if [[ -n "ZWIFT_FG" ]]
then
ZWIFT_FG_FLAG = "-it" # run in foreground
else
ZWIFT_FG_FLAG = "-d" # run in background
fi

# Setup Flags for Window Managers
if [ $WINDOW_MANAGER == "Wayland" ]; then
WM_FLAGS=(
Expand Down Expand Up @@ -251,6 +258,7 @@ fi
#########################
##### RUN CONTAINER #####
CONTAINER=$($CONTAINER_TOOL run ${GENERAL_FLAGS[@]} \
$ZWIFT_FG_FLAG \
$ZWIFT_CONFIG_FLAG \
$ZWIFT_USER_CONFIG_FLAG \
$ZWIFT_WORKOUT_VOL \
Expand Down

0 comments on commit a53d2d8

Please sign in to comment.