Last active
September 15, 2017 15:17
-
-
Save Matherunner/18b838236670df58ddc989d42a594eec to your computer and use it in GitHub Desktop.
Helper script to launch Half-Life from the command line for Linux users. Usage: runhl.sh [args...]
This file contains 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
#!/usr/bin/env bash | |
set -ex | |
# Check your distribution to find out how it runs Steam. | |
# Replace 1 with 0 if it's not using Steam's bundled libraries. | |
USE_STEAM_BUNDLED_LIBRARIES=1 | |
# Make sure the paths below do not contain spaces. | |
# Set this to the full path to your libBunnymodXT.so | |
export LD_PRELOAD=/full/path/to/libBunnymodXT.so | |
# Set this to the full path to the .steam folder, usually ~/.steam | |
# This folder should contain bin32 and steam folders/symlinks. | |
export STEAM_ROOT=~/.steam | |
# Set this to the path to your Half-Life folder, usually $STEAM_ROOT/steam/steamapps/common/Half-Life | |
export HL_ROOT=$STEAM_ROOT/steam/steamapps/common/Half-Life | |
if [ "$USE_STEAM_BUNDLED_LIBRARIES" -eq 1 ]; then | |
export PLATFORM=bin32 | |
export STEAM_RUNTIME=$STEAM_ROOT/$PLATFORM/steam-runtime | |
export LD_LIBRARY_PATH=\ | |
$HL_ROOT:\ | |
$STEAM_ROOT/$PLATFORM:\ | |
$STEAM_RUNTIME/i386/lib/i386-linux-gnu:\ | |
$STEAM_RUNTIME/i386/lib:\ | |
$STEAM_RUNTIME/i386/usr/lib/i386-linux-gnu:\ | |
$STEAM_RUNTIME/i386/usr/lib:\ | |
$STEAM_RUNTIME/amd64/lib/x86_64-linux-gnu:\ | |
$STEAM_RUNTIME/amd64/lib:\ | |
$STEAM_RUNTIME/amd64/usr/lib/x86_64-linux-gnu:\ | |
$STEAM_RUNTIME/amd64/usr/lib:\ | |
/usr/lib32 | |
else | |
export LD_LIBRARY_PATH=$HL_ROOT:/usr/lib32 | |
fi | |
cd $HL_ROOT | |
exec ./hl_linux -steam "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment