Skip to content

Instantly share code, notes, and snippets.

@daktak
Created December 14, 2021 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daktak/d40f4f07e77b0a1d379e2ba7436cdba6 to your computer and use it in GitHub Desktop.
Save daktak/d40f4f07e77b0a1d379e2ba7436cdba6 to your computer and use it in GitHub Desktop.
Set world in Zwift prefs.
#!/bin/bash
USER=`whoami`
DIR="/home/${USER}/Games/zwift/drive_c/users/daktak/Documents/Zwift"
case $1 in
1 | Watopia )
WORLD=2
;;
2 | Richmond )
WORLD=2
;;
3 | London )
WORLD=3
;;
4 | "New York" | NY )
WORLD=4
;;
5 | Innsbruck )
WORLD=5
;;
7 | Yorkshire )
WORLD=7
;;
9 | "Makuri Island" | MI )
WORLD=9
;;
10 | France )
WORLD=10
;;
11 | Paris )
WORLD=11
;;
esac
if [[ -z $WORLD ]]; then
xmlstarlet ed --inplace -d //ZWIFT//WORLD \
$DIR/prefs.xml
else
xmlstarlet ed --inplace \
--subnode ZWIFT --type elem --name "WORLD" --value $WORLD \
$DIR/prefs.xml
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment