Skip to content

Instantly share code, notes, and snippets.

@XxUnkn0wnxX
Last active November 5, 2025 21:27
Show Gist options
  • Select an option

  • Save XxUnkn0wnxX/c6372b5cd30ca3b71c740e4ef7af78b9 to your computer and use it in GitHub Desktop.

Select an option

Save XxUnkn0wnxX/c6372b5cd30ca3b71c740e4ef7af78b9 to your computer and use it in GitHub Desktop.
A macos (x64 & ARM) script to run satisfactory-modeler better
#!/usr/bin/env zsh
# Quick launcher for Satisfactory Modeler with Hi-DPI flags
# Place this script in the same folder as modeler.jar and run it directly.
# Always launches DETACHED so Terminal can be closed immediately.
set -euo pipefail
# --- locate script dir and jar ---
SCRIPT_PATH=${0:A}
SCRIPT_DIR=${SCRIPT_PATH:h}
cd "${SCRIPT_DIR}"
# Pin Java 25 explicitly for this launch
export JAVA_HOME="$(/usr/libexec/java_home -v 25)"
JAVA_EXE="$JAVA_HOME/bin/java"
# Determine display scale dynamically (macOS main display)
get_scale() {
osascript -l JavaScript -e 'ObjC.import("AppKit"); ($.NSScreen.mainScreen ? $.NSScreen.mainScreen.backingScaleFactor : 1.0)' 2>/dev/null || echo 1.0
}
SCALE="$(get_scale)"
# Map Retina (2.0) to preferred 1.5 UI scale
[[ "$SCALE" = 2.* ]] && SCALE=1.5
JAR="modeler.jar"
if [[ ! -f "$JAR" ]]; then
print -u2 -- "Error: ${JAR} not found in ${SCRIPT_DIR}"
exit 1
fi
# --- build the java command (array-safe) ---
JAVA_CMD=( "$JAVA_EXE" \
-Dsun.java2d.uiScale.enabled=true \
-Dsun.java2d.uiScale="$SCALE" \
-Dawt.useSystemAAFontSettings=on \
-Dswing.aatext=true \
-Dprism.allowhidpi=true \
-Dapple.awt.application.name="Satisfactory Modeler" \
-Xdock:name="Satisfactory Modeler" \
-jar "$JAR" )
# --- launch detached (no logs) ---
nohup "${JAVA_CMD[@]}" >/dev/null 2>&1 &
pid=$!
# If running in an interactive shell with job control, cut ties with the job
(disown "$pid" 2>/dev/null || true)
# Save PID next to the jar for convenience
JAR_PATH="${JAR:A}"
PID_FILE="${JAR_PATH:h}/modeler.pid"
echo "$pid" > "$PID_FILE"
echo "Launched Satisfactory Modeler (PID $pid) in detached mode. No logs (stdout/stderr -> /dev/null)."
echo "PID file: $PID_FILE"
exit 0
@XxUnkn0wnxX
Copy link
Author

Be sure to run chmod +x run.zsh to make it executable.

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