diff --git a/zwift.sh b/zwift.sh index 9052d25..2faaeac 100755 --- a/zwift.sh +++ b/zwift.sh @@ -25,6 +25,20 @@ NETWORKING=${NETWORKING:-bridge} ZWIFT_UID=${ZWIFT_UID:-$(id -u)} ZWIFT_GID=${ZWIFT_GID:-$(id -g)} +# Check for other zwift configuration, sourced here and passed on to container aswell +if [[ -f "$HOME/.config/zwift/config" ]] +then + ZWIFT_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" + source $HOME/.config/zwift/config +fi + +# Check for $USER specific zwift configuration, sourced here and passed on to container aswell +if [[ -f "$HOME/.config/zwift/$USER-config" ]] +then + ZWIFT_USER_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" + source $HOME/.config/zwift/config +fi + # Define Base Container Parameters GENERAL_FLAGS=( -d @@ -45,20 +59,6 @@ GENERAL_FLAGS=( -v zwift-$USER:/home/user/.wine/drive_c/users/user/Documents/Zwift ) -# Check for other zwift configuration, sourced here and passed on to container aswell -if [[ -f "$HOME/.config/zwift/config" ]] -then - ZWIFT_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" - source $HOME/.config/zwift/config -fi - -# Check for $USER specific zwift configuration, sourced here and passed on to container aswell -if [[ -f "$HOME/.config/zwift/$USER-config" ]] -then - ZWIFT_USER_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" - source $HOME/.config/zwift/config -fi - ### UPD SCRIPTS and CONTAINER ### # Check for updated zwift.sh if [[ ! $DONT_CHECK ]] @@ -165,4 +165,4 @@ CONTAINER=$($CONTAINER_TOOL run ${GENERAL_FLAGS[@]} \ if [[ -z $WAYLAND_DISPLAY && $ZWIFT_UID -ne $(id -u) ]] then xhost +local:$($CONTAINER_TOOL inspect --format='{{ .Config.Hostname }}' $CONTAINER) -fi \ No newline at end of file +fi