Skip to content

Instantly share code, notes, and snippets.

@sm9cc
Last active October 1, 2023 10:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sm9cc/addf48def898bb2be72cba36e16d6f5a to your computer and use it in GitHub Desktop.
Save sm9cc/addf48def898bb2be72cba36e16d6f5a to your computer and use it in GitHub Desktop.
CSGO Launch Workaround
#!/usr/bin/env bash
# shellcheck disable=SC2086
# Linux CSGO Launch Workaround
# Issue: https://github.com/ValveSoftware/csgo-osx-linux/issues/3097
# Launcher paths
declare -a CSGO_LAUNCHER_PATHS=(
"${HOME}/.steam/steam/steamapps/common/Counter-Strike Global Offensive/csgo.sh"
"${HOME}/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/csgo.sh"
"${HOME}/Games/steamapps/common/Counter-Strike Global Offensive/csgo.sh"
)
# Game arguments
declare -gr CSGO_ARGS="-steam -console -novid -nojoy -tickrate 128 +fps_max 0 -preload -maxdownloadfilesizemb 500 +engine_no_focus_sleep 0 +exec autoexec.cfg"
function launch_csgo() {
local launcher_found=false
for launcher_path in "${CSGO_LAUNCHER_PATHS[@]}"; do
if [[ -x "${launcher_path}" ]]; then
(STEAM_RUNTIME=1 i386 "${launcher_path}" ${CSGO_ARGS} &)
launcher_found=true
break
fi
done
if [[ ! ${launcher_found} ]]; then
echo "CSGO launcher not found in any of the specified paths."
exit 1
fi
}
launch_csgo
@sm9cc
Copy link
Author

sm9cc commented Oct 1, 2023

Quick Guide to playing CSGO and CS2 on Linux

Tutorial.webm

Adjust Compatibility Settings

  1. Open Steam.
  2. Go to Steam library, Right click Counter-Strike 2, Select Properties...
  3. Under Compatibility Uncheck Force specific Steam Play compatibility tool if enabled.

Selecting Beta Branch

  1. In the Betas tab Under Beta Participation, choose csgo_demo_viewer - 1.38.7.9
  2. Allow Steam to download the necessary files; this may take a while.

Setting Up the CSGO Launch Script

  1. Open a terminal.
  2. Create a script directory: mkdir ~/Scripts (Optional, use whatever directory you want)
  3. Download the CSGO launch script: wget https://gist.githubusercontent.com/sm9cc/addf48def898bb2be72cba36e16d6f5a/raw/2755ca3893bee73aab11975d4cd4e50093e04e25/LaunchCSGO.sh -P ~/Scripts (If necessary, replace with your own directory)
  4. Make the script executable: chmod +x ~/Scripts/LaunchCSGO.sh (If necessary, replace with your own directory)
  5. If necessary, customize the script to add your launch arguments and specify your csgo.sh path. To locate the path, follow these steps:
    • Right-click on Counter-Strike: 2 in the Steam library.
    • Select Properties... -> Installed Files -> Browse...

Add the script to Steam:

  1. Open Steam Library.
  2. Click Add a Game and choose Add a Non-Steam Game...
  3. Click Browse and select the script. Ensure it's checked.
  4. Click Add Selected Programs.
  5. Right-click on LaunchCSGO.sh in the Steam library, select Properties...
  6. Change the name to Counter-Strike: Global Offensive

Playing CSGO / CS2

  1. Launch Counter-Strike: Global Offensive in your Steam library as you always used to.
  2. Join a community server or play with bots.
  3. Have fun!

CS2 will remain updated while you are on this branch, so you can play both games without having to switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment