#!/usr/bin/env sh

# This script forces the steam launch script to always use the -steamdeck flag.
# This prevents Desktop Mode from re-downloading the desktop client every time you switch between Game Mode and Desktop mode.

if [ "$EUID" -ne 0 ]; then
  echo "This script can only be run if you are root."
  exit
fi

! grep -q "steamdeck" /usr/bin/steam && sed -i "s/\/steam /\/steam -steamdeck /" /usr/bin/steam
exit 0
