Thought I’d share it here in case anyone was looking for something similar. It’s based on the Windows instructions found here, but also adds GUI via kdialog.

This will create a folder next to the script named .gw2-account-manage and copy the Local.dat files between this folder and the game’s appdata folder. To set it up, you just need to save this script to a file somewhere (I have it in /home/deck/gw2-account-manage), make it executable via chmod +x gw2-account-manage, and update the launch options in Steam.

Launch options should look something like this: /home/deck/gw2-account-manage "gamemoderun %command%"

You should be able to name each entry whatever you want - I just used account name since that’s easier for me. Though I haven’t tested it very thoroughly with special characters.

#!/bin/bash

datfile="/home/deck/.local/share/Steam/steamapps/compatdata/1284210/pfx/drive_c/users/steamuser/AppData/Roaming/Guild Wars 2/Local.dat"

parentdir=$(readlink -f $(dirname "$0"))
gw2amdir="$parentdir/.gw2-account-manage"

if [ ! -f "$datfile" ]; then
    kdialog --error "Local.dat not found.\n\nExpected at:\n$datfile"
    exit
fi

mkdir -p "$gw2amdir"

choose() {
    options=""
    files=$(find "$gw2amdir" -type f -print0 | xargs -0 ls -tU)
    while read file; do
        options="$options \"$file\" \"$(basename $file)\""
    done < <(echo "$files")
    options="$options \"+\" \"Add a new account...\""

    choice=$(echo "$options" | xargs kdialog --menu \
        "Select an account:")

    if [ "+" = "$choice" ]; then
        newname=$(kdialog --inputbox "Account Name")
        if [ "$newname" ]; then
            cp "$datfile" "$gw2amdir/$newname"
        fi
        choose "$@"
    elif [ -f "$choice" ]; then
        cp -r "$choice" "$datfile"
        eval "$@"
        cp -r "$datfile" "$choice"
    fi
}

choose "$@"
  •  Sina   ( @Sina@beehaw.org ) 
    link
    fedilink
    English
    1
    edit-2
    1 year ago

    This is very nice and polished!

    I use separate scripts for each of my 2 accounts to very quickly start up the game on them with just a double click. >>>

    #!/bin/sh
    cd "/home/XYZ/.steam/steam/steamapps/compatdata/2720354863/pfx/drive_c/users/steamuser/AppData/Roaming/Guild Wars 2"
    cp Local2.dat Local.dat
    sleep 1 
    steam steam://rungameid/11683835170133114880
    
    

    (but the folders and game id launching would both need to be edited to fit the individual user’s machine + make a Local1 Local2 etc dat files manually before running the script)