Skip to content

Commit da5d64a

Browse files
stirbyS1M0N38
authored andcommitted
added proton/linux support for balatro.sh
1 parent 82eb2f3 commit da5d64a

File tree

1 file changed

+36
-19
lines changed

1 file changed

+36
-19
lines changed

balatro.sh

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,18 @@ get_platform_config() {
149149
PROCESS_PATTERNS=("Balatro\.app" "balatro\.sh")
150150
;;
151151
linux)
152-
# TODO: Implement Linux paths
153-
# Common Linux Steam paths to check:
154-
# - ~/.steam/steam/steamapps/common/Balatro
155-
# - ~/.local/share/Steam/steamapps/common/Balatro
156-
# - Custom detection logic
157-
echo "Error: Linux support is not yet implemented" >&2
158-
echo "TODO: Add Linux Steam path detection and configuration" >&2
159-
exit 1
160-
# STEAM_PATH="TODO: Implement Linux Steam path detection"
161-
# LIBRARY_ENV_VAR="LD_PRELOAD"
162-
# LIBRARY_FILE="liblovely.so"
163-
# BALATRO_EXECUTABLE="Balatro"
164-
# TODO: Verify actual Linux process names for process killing
165-
# PROCESS_PATTERNS=("Balatro" "balatro\.sh")
152+
# Linux configuration using Proton (Steam Play)
153+
PREFIX="$HOME/.steam/steam/steamapps/compatdata/2379780"
154+
PROTON_DIR="$HOME/.steam/steam/steamapps/common/Proton 9.0 (Beta)"
155+
EXE="$HOME/.steam/debian-installation/steamapps/common/Balatro/Balatro.exe"
156+
157+
STEAM_PATH="$PROTON_DIR"
158+
LIBRARY_ENV_VAR="" # Not used on Linux when running via Proton
159+
LIBRARY_FILE=""
160+
BALATRO_EXECUTABLE="proton"
161+
# Patterns of processes that should be terminated when cleaning up existing Balatro instances.
162+
# Do NOT include "balatro\.sh" – it would match this launcher script and terminate it.
163+
PROCESS_PATTERNS=("Balatro\.exe" "proton")
166164
;;
167165
*)
168166
echo "Error: Unsupported platform configuration" >&2
@@ -232,11 +230,30 @@ start_balatro_instance() {
232230
fi
233231

234232
# Set up platform-specific Balatro configuration
235-
export ${LIBRARY_ENV_VAR}="${STEAM_PATH}/${LIBRARY_FILE}"
236-
237-
# Start the process
238-
"${STEAM_PATH}/${BALATRO_EXECUTABLE}" >"$log_file" 2>&1 &
239-
local pid=$!
233+
# Platform-specific launch
234+
if [[ "$PLATFORM" == "linux" ]]; then
235+
PREFIX="$HOME/.steam/steam/steamapps/compatdata/2379780"
236+
PROTON_DIR="$STEAM_PATH"
237+
EXE="$HOME/.steam/debian-installation/steamapps/common/Balatro/Balatro.exe"
238+
239+
# Steam / Proton context
240+
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.steam/steam"
241+
export STEAM_COMPAT_DATA_PATH="$PREFIX"
242+
export SteamAppId=2379780
243+
export SteamGameId=2379780
244+
export WINEPREFIX="$PREFIX/pfx"
245+
246+
# load Lovely/SteamModded
247+
export WINEDLLOVERRIDES="version=n,b"
248+
249+
# Run via Proton
250+
(cd "$WINEPREFIX" && "$PROTON_DIR/proton" run "$EXE") >"$log_file" 2>&1 &
251+
local pid=$!
252+
else
253+
export ${LIBRARY_ENV_VAR}="${STEAM_PATH}/${LIBRARY_FILE}"
254+
"${STEAM_PATH}/${BALATRO_EXECUTABLE}" >"$log_file" 2>&1 &
255+
local pid=$!
256+
fi
240257

241258
# Verify process started
242259
sleep 2

0 commit comments

Comments
 (0)