๐ŸŽฎ Purpose

Running games via Steam on Linux requires different flags for different engines, various environment variables for AMD and NVIDIA, and manual insertion of tools like Gamescope and MangoHud into the launch command.

Solution: steamscope.sh - a wrapper script that:

  • โœ… Auto-detects GPU (AMD/NVIDIA) and applies appropriate optimizations
  • โœ… Supports engine-specific flags: Source, Unreal, Unity
  • โœ… Integrates Gamescope, Gamemode, MangoHud, FSR in one command
  • โœ… Works as %command% in Steam launch options
  • โœ… Doesn’t break standard launch - everything is optional

๐Ÿ’ก The script doesn’t replace Proton or Steam - it makes their work predictable and configurable.


๐Ÿ“ฆ Installation

Step 1: Download the script

# Create directory (if missing)
mkdir -p ~/.steam/steam/

# Download script
curl -o ~/.steam/steam/steamscope.sh \
  https://gist.githubusercontent.com/ponfertato/85fc964664423eae1ac0a7ee91d53db6/raw/steamscope.sh

# Make executable
chmod +x ~/.steam/steam/steamscope.sh

Step 2: Configure game in Steam

  1. Right-click game โ†’ Properties
  2. In Launch Options, add:
    ~/.steam/steam/steamscope.sh %command%
    
  3. (Optional) Add flags:
    ~/.steam/steam/steamscope.sh --gamemode --mangohud --engine=source %command%
    

Done. When launching the game, the script will automatically apply settings.


โš™๏ธ Launch parameters (by category)

๐Ÿš€ Performance

FlagDescriptionFor whom
--gamemodeEnables gamemoderun for process priorityEveryone, especially on weak systems
--fsrEnables FSR upscaling via VKD3D (AMD) / DXVK (NVIDIA)AMD GPU, low native FPS
--dxvkForces DXVK instead of D9VKGames with DirectX 9/10/11

๐Ÿ‘ Monitoring

FlagDescriptionExample output
--mangohudShows overlay with FPS, CPU/GPU load, tempsFPS: 87 โ”‚ CPU: 45% โ”‚ GPU: 72ยฐC

๐Ÿ–ฅ Runtime mode

FlagDescriptionPurpose
--gamescopeRuns game in isolated Wayland session via GamescopeStable FPS, adaptive sync, scaling
--resolution=1280x720Sets resolution for Gamescope (default: native)Testing, reducing load

๐ŸŽฏ Engines

FlagSupported enginesExample games
--engine=sourceSource 1/2CS2, TF2, Garry’s Mod, Left 4 Dead 2
--engine=unrealUnreal Engine 3/4/5Risk of Rain 2, Deep Rock Galactic, Satisfactory
--engine=unityUnity7 Days to Die, Valheim, Among Us

What each engine adds:

  • Source: -high -threads N +mat_vsync 0 +fps_max 0 +exec autoexec.cfg
  • Unreal: -dx12 -nomansky -notexturestreaming -nomovie
  • Unity: -screen-width W -screen-height H -nolog -batchmode

๐Ÿ”ง How it works (under the hood)

Auto-detect hardware

# Script checks GPU via lspci
GPU_INFO=$(lspci -k 2>/dev/null | awk '/VGA|3D/,/Kernel driver/ {if (/Kernel driver in use/) print $NF}' | tail -1)

# For AMD:
[[ "$GPU_INFO" == *"amdgpu"* ]] && USE_AMD=true
# โ†’ Adds: RADV_PERFTEST=aco, AMD_DEBUG=nodcc

# For NVIDIA:
[[ "$GPU_INFO" == *"nvidia"* ]] && USE_NVIDIA=true
# โ†’ Adds: PROTON_ENABLE_NVAPI=1, __NV_PRIME_RENDER_OFFLOAD=1

Building the final command

The script builds the command in “layers”:

[gamemoderun] โ†’ [mangohud] โ†’ [gamescope -- ...] โ†’ [GAME + engine flags]

Each layer is added only if the corresponding flag is passed.

Handling %command%

Steam passes the launch command as %command%. The script:

  1. Finds the position after the executable (but not inside proton, steam-runtime, etc.)
  2. Inserts engine flags after the executable but before game arguments
  3. This ensures flags reach the game, not the launcher

Counter-Strike 2 (Source Engine, AMD)

~/.steam/steam/steamscope.sh \
  --engine=source \
  --gamemode \
  --mangohud \
  --fsr \
  --gamescope \
  %command%

What the game gets:

  • Process priority via gamemoderun
  • MangoHud overlay with metrics
  • FSR upscaling via VKD3D (for higher FPS)
  • Launch in Gamescope with adaptive sync
  • Optimized Source flags: -high -threads 8 +fps_max 0

Deep Rock Galactic (Unreal Engine, NVIDIA)

~/.steam/steam/steamscope.sh \
  --engine=unreal \
  --gamemode \
  --dxvk \
  --mangohud \
  %command%

Highlights:

  • --dxvk enables DXVK for better Vulkan compatibility on NVIDIA
  • Unreal flags disable heavy effects: -nomansky -notexturestreaming
  • UE5_ALLOW_LINUX_DEBUGGING=1 for Linux stability

7 Days to Die (Unity, cross-platform)

~/.steam/steam/steamscope.sh \
  --engine=unity \
  --gamemode \
  --fsr \
  --resolution=1280x720 \
  %command%

Purpose:

  • --resolution reduces load for smoother gameplay
  • --fsr compensates detail loss with upscaling
  • Unity flags disable logging: -nolog -batchmode

๐Ÿ›  Configuration tips

Start minimal

# Game only (basic launch)
~/.steam/steam/steamscope.sh %command%

# + monitoring
~/.steam/steam/steamscope.sh --mangohud %command%

# + optimization
~/.steam/steam/steamscope.sh --gamemode --mangohud %command%

Add parameters one by one - easier to find what breaks.

If the game crashes

  1. Disable --gamescope - most common source of conflicts
  2. Disable --gamemode - may conflict with system settings
  3. Check logs:
    journalctl -f | grep -i steam
    

Resolution and scaling

  • By default, script gets native resolution via xrandr
  • To force change: --resolution=1280x720
  • Combined with --gamescope and --fsr gives flexible quality/performance control

Localization

The script sets:

export LANG="ru_RU.UTF-8"
export LC_ALL="ru_RU.UTF-8"

If game requires English locale - override in launch options:

LANG=en_US.UTF-8 ~/.steam/steam/steamscope.sh %command%

โš ๏ธ Common issues

# "gamescope: command not found"
โ†’ Install:
  # Arch: sudo pacman -S gamescope
  # Debian/Ubuntu: sudo apt install gamescope
  # Fedora: sudo dnf install gamescope

# "gamemoderun: command not found"
โ†’ Install:
  # All distros: sudo apt install gamemode or equivalent

# Game ignores engine flags
โ†’ Ensure %command% is at the end of the launch string
โ†’ Verify the game actually uses the expected engine (not all "names" match reality)

# No MangoHud overlay
โ†’ Ensure mangohud is installed and in PATH
โ†’ Some games require: export MANGOHUD_DLSYM=1 (script does this automatically)

# Low FPS after enabling --fsr
โ†’ FSR is upscaling, not magic: it boosts FPS at the cost of quality
โ†’ Try lowering --resolution together with --fsr

# Script doesn't detect GPU
โ†’ Ensure pciutils is installed: sudo apt install pciutils
โ†’ Check output: lspci -k | grep -A2 -i vga

๐Ÿ” Security and privacy

The script does not collect data, send anything over the network, or work outside the local system.

What it does:

  • Reads lspci to detect GPU (for optimizations only)
  • Sets environment variables for the game process
  • Does not modify game or system files

Recommendations:

  • Download script only from official gist
  • Verify hash when updating (optional)
  • Don’t pass sensitive data in script arguments