Skip to content

Instantly share code, notes, and snippets.

@MantasMikal
Last active November 7, 2025 23:02
Show Gist options
  • Select an option

  • Save MantasMikal/7504f3747d5541efcc39296432126cae to your computer and use it in GitHub Desktop.

Select an option

Save MantasMikal/7504f3747d5541efcc39296432126cae to your computer and use it in GitHub Desktop.
Fix Avorion cursor offset on mac
#!/bin/bash
echo "=========================================="
echo "Avorion Mac Notch Fix - Setup Script"
echo "=========================================="
echo ""
# Get the script's directory (should be Avorion game folder)
GAME_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "Game directory: $GAME_DIR"
echo ""
# Check if we're in the right place
if [ ! -f "$GAME_DIR/bin/Avorion" ]; then
echo "❌ ERROR: Cannot find Avorion executable"
echo "Please run this script from your Avorion game folder."
echo ""
echo "Expected location:"
echo "~/Library/Application Support/Steam/steamapps/common/Avorion/"
echo ""
read -p "Press Enter to exit..."
exit 1
fi
echo "✅ Found Avorion game files"
echo ""
# Check if Avorion.app already exists
if [ -d "$GAME_DIR/Avorion.app" ]; then
echo "⚠️ Avorion.app already exists!"
read -p "Do you want to recreate it? (y/n): " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Setup cancelled."
read -p "Press Enter to exit..."
exit 0
fi
echo "Removing old Avorion.app..."
rm -rf "$GAME_DIR/Avorion.app"
fi
# Create directory structure
echo "Creating Avorion.app structure..."
mkdir -p "$GAME_DIR/Avorion.app/Contents/MacOS"
mkdir -p "$GAME_DIR/Avorion.app/Contents/Resources"
# Create Info.plist
echo "Creating Info.plist..."
cat > "$GAME_DIR/Avorion.app/Contents/Info.plist" << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>AvorionWrapper</string>
<key>CFBundleIdentifier</key>
<string>net.avorion.game</string>
<key>CFBundleName</key>
<string>Avorion</string>
<key>CFBundleDisplayName</key>
<string>Avorion</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.5.10</string>
<key>CFBundleVersion</key>
<string>2.5.10</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
EOF
# Create wrapper script
echo "Creating portable launcher script..."
cat > "$GAME_DIR/Avorion.app/Contents/MacOS/AvorionWrapper" << 'EOF'
#!/bin/bash
# Avorion Wrapper for macOS Notch Fix - Portable Version
# Function to find Avorion installation
find_avorion() {
# Common Steam installation paths
local STEAM_PATHS=(
"$HOME/Library/Application Support/Steam/steamapps/common/Avorion"
"$HOME/.steam/steam/steamapps/common/Avorion"
"/Applications/Steam/steamapps/common/Avorion"
)
# Check each path
for path in "${STEAM_PATHS[@]}"; do
if [ -f "$path/bin/Avorion" ]; then
echo "$path"
return 0
fi
done
# If not found, prompt user
osascript <<EOSDIALOG
tell application "System Events"
display dialog "Could not find Avorion installation.\n\nPlease make sure Avorion is installed via Steam." buttons {"OK"} default button "OK" with icon stop with title "Avorion"
end tell
EOSDIALOG
return 1
}
# Find the game directory
GAME_DIR=$(find_avorion)
if [ -z "$GAME_DIR" ]; then
exit 1
fi
BIN_DIR="$GAME_DIR/bin"
# Check if Steam is running
if ! pgrep -x "steam_osx" > /dev/null && ! pgrep -x "Steam" > /dev/null; then
osascript <<EOSDIALOG
tell application "System Events"
display dialog "Steam must be running to launch Avorion.\n\nPlease start Steam and try again." buttons {"OK"} default button "OK" with icon stop with title "Avorion"
end tell
EOSDIALOG
exit 1
fi
# Set up environment for Steam API
export DYLD_LIBRARY_PATH="$BIN_DIR:$DYLD_LIBRARY_PATH"
export DYLD_FRAMEWORK_PATH="$BIN_DIR:$DYLD_FRAMEWORK_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$BIN_DIR:$DYLD_FALLBACK_LIBRARY_PATH"
# Set Steam App ID
export SteamAppId=445220
export SteamGameId=445220
export STEAM_RUNTIME=0
# SDL hints to handle Mac notch
export SDL_VIDEO_MAC_FULLSCREEN_SPACES=0
export SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES=0
# Find Steam libraries
STEAM_ROOT="$HOME/Library/Application Support/Steam"
if [ -d "$STEAM_ROOT/Steam.AppBundle/Steam/Contents/MacOS" ]; then
export DYLD_LIBRARY_PATH="$STEAM_ROOT/Steam.AppBundle/Steam/Contents/MacOS:$DYLD_LIBRARY_PATH"
fi
# Launch the game
cd "$GAME_DIR"
exec "$BIN_DIR/Avorion" --serverpath "$BIN_DIR/AvorionServer" "$@"
EOF
# Make script executable
chmod +x "$GAME_DIR/Avorion.app/Contents/MacOS/AvorionWrapper"
# Create PkgInfo
echo -n "APPLGGAM" > "$GAME_DIR/Avorion.app/Contents/PkgInfo"
# Register with macOS
echo "Registering with macOS..."
xattr -cr "$GAME_DIR/Avorion.app"
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "$GAME_DIR/Avorion.app" 2>/dev/null
touch "$GAME_DIR/Avorion.app"
echo ""
echo "=========================================="
echo " Setup Complete"
echo "=========================================="
echo ""
echo "Avorion.app has been created successfully!"
echo "Current location:"
echo "$GAME_DIR/Avorion.app"
echo ""
read -p "Press Enter to exit..."
@MantasMikal
Copy link
Author

MantasMikal commented Nov 7, 2025

To anyone stumbling upon this,

  1. Download the script, place it in Avorion game directory e.g. ~/Library/Application Support/Steam/steamapps/common/Avorion
  2. Run it via terminal
  3. It will create create Avorion.app in the same directory with the offset fixed. Just run the game trough that and it should work. After the app is created you can just move it to the Applications folder

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