Created
December 30, 2025 20:14
-
-
Save nukhes/b36f127db5cf5b64a81f0bab206a3f61 to your computer and use it in GitHub Desktop.
Speed up Steam's Shader in Linux Machines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This script optimizes Steam's background shader compilation by automatically configuring the steam_dev.cfg file | |
| # to use your total CPU threads minus four, a calculation designed to maximize processing speed while reserving | |
| # enough resources to prevent system freezes. It functions idempotently, meaning it first checks if the configuration | |
| # file exists (creating it if necessary) and then uses sed to either update the existing unShaderBackgroundProcessingThreads | |
| # line or append it if missing. | |
| CONFIG_FILE="$HOME/.local/share/Steam/steam_dev.cfg" | |
| TOTAL_THREADS=$(nproc) | |
| TARGET_THREADS=$((TOTAL_THREADS - 4)) | |
| if [ "$TARGET_THREADS" -lt 1 ]; then | |
| TARGET_THREADS=1 | |
| fi | |
| if [ ! -d "$(dirname "$CONFIG_FILE")" ]; then | |
| echo "Steam directory not found." | |
| exit 1 | |
| fi | |
| if [ ! -f "$CONFIG_FILE" ]; then | |
| touch "$CONFIG_FILE" | |
| fi | |
| if grep -q "^unShaderBackgroundProcessingThreads" "$CONFIG_FILE"; then | |
| sed -i "s/^unShaderBackgroundProcessingThreads .*/unShaderBackgroundProcessingThreads $TARGET_THREADS/" "$CONFIG_FILE" | |
| else | |
| echo "unShaderBackgroundProcessingThreads $TARGET_THREADS" >> "$CONFIG_FILE" | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with one command.
curl -fsSL https://gist.githubusercontent.com/nukhes/b36f127db5cf5b64a81f0bab206a3f61/raw/ | sh