Skip to content

Instantly share code, notes, and snippets.

@giantorth
Last active September 3, 2025 12:37
Show Gist options
  • Save giantorth/0b68cfb5cd533d5d83757df6c51f7bf1 to your computer and use it in GitHub Desktop.
Save giantorth/0b68cfb5cd533d5d83757df6c51f7bf1 to your computer and use it in GitHub Desktop.
Updates Disco Elysium resolution in Settings.json to match the PRIMARY display
#!/bin/bash
# disco.sh
# Updates Disco Elysium resolution in Settings.json to match the PRIMARY display in Linux
#
# Set LAUNCH OPTIONS in steam to: /path/of/script/disco.sh %COMMAND%
# Don't forget to make script executable: chmod +x disco.sh
# 1. Get current resolution of the primary display using xrandr
resolution=$(xrandr | awk '/ connected primary / {print $4}' | cut -d+ -f1)
if [ -z "$resolution" ]; then
echo "Could not determine primary display resolution with xrandr."
exit 1
fi
echo "Detected primary display resolution: $resolution"
# 2. Split resolution into width and height
width=$(echo "$resolution" | cut -d'x' -f1)
height=$(echo "$resolution" | cut -d'x' -f2)
# 3. Define path to Settings.json
jsonFilePath="$HOME/.local/share/Steam/steamapps/compatdata/632470/pfx/drive_c/users/steamuser/AppData/LocalLow/ZAUM Studio/Disco Elysium/Settings/Settings.json"
backupFilePath="${jsonFilePath}.bak"
# 4. Backup
if [ ! -f "$backupFilePath" ]; then
cp "$jsonFilePath" "$backupFilePath"
echo "Backed up Settings.json to Settings.json.bak"
else
echo "Backup already exists. Skipping."
fi
# 5. Modify the JSON using jq
tmpFile=$(mktemp)
# Insert new values and keep same indent as how game saves it
jq --argjson w "$width" --argjson h "$height" '
.GRAPHICS.resolutionWidth.intValue = $w
| .GRAPHICS.resolutionHeight.intValue = $h
| .
' "$jsonFilePath" | python3 -m json.tool --indent 4 > "$tmpFile"
# 6. Save changes back to the file
mv "$tmpFile" "$jsonFilePath"
echo "Updated resolution in Settings.json to ${width}x${height}"
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment