Add Battle.net installer
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Battle.net
|
||||
GenericName=Game Launcher
|
||||
Comment=Blizzard game launcher (umu-launcher + GE-Proton)
|
||||
Exec=omarchy-launch-battlenet
|
||||
Icon=Battle.net
|
||||
Terminal=false
|
||||
Categories=Game;
|
||||
StartupNotify=true
|
||||
StartupWMClass=battle.net.exe
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
Executable
+91
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Install Battle.net standalone via umu-launcher + GE-Proton (no Steam, no Lutris, no Heroic).
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
PREFIX="$HOME/Games/battlenet"
|
||||
LAUNCHER="$PREFIX/drive_c/Program Files (x86)/Battle.net/Battle.net Launcher.exe"
|
||||
INSTALLER_URL="https://downloader.battle.net/download/getInstallerForGame?os=win&gameProgram=BATTLENET_APP&version=Live"
|
||||
|
||||
echo "Installing Battle.net..."
|
||||
|
||||
omarchy-pkg-add umu-launcher
|
||||
omarchy-install-gaming-gpu-lib32
|
||||
|
||||
# Detect a half-finished prefix from a closed/crashed previous run and offer
|
||||
# to wipe it before trying again. Battle.net's installer isn't idempotent.
|
||||
if [[ -d $PREFIX && ! -f $LAUNCHER ]]; then
|
||||
echo
|
||||
echo "Found a partial Battle.net install at $PREFIX (no Launcher.exe)."
|
||||
echo "Battle.net's installer can't resume from this state."
|
||||
if gum confirm "Wipe the partial prefix and start fresh?"; then
|
||||
pkill -f "$PREFIX" 2>/dev/null || true
|
||||
sleep 1
|
||||
rm -rf "$PREFIX"
|
||||
else
|
||||
echo "Aborting. Re-run when ready to wipe."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "$PREFIX"
|
||||
|
||||
export WINEPREFIX="$PREFIX"
|
||||
export PROTONPATH=GE-Proton
|
||||
export GAMEID=umu-battlenet
|
||||
export PROTON_VERB=run
|
||||
|
||||
if [[ -f "$LAUNCHER" ]]; then
|
||||
echo "Battle.net is already installed at $PREFIX."
|
||||
launched_installer=0
|
||||
else
|
||||
cache_dir="$HOME/.cache/omarchy"
|
||||
mkdir -p "$cache_dir"
|
||||
installer="$cache_dir/Battle.net-Setup.exe"
|
||||
|
||||
echo
|
||||
echo "Downloading Battle.net installer..."
|
||||
curl --fail --location --retry 3 "$INSTALLER_URL" --output "$installer"
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
Launching the Battle.net setup wizard. Click through it normally — the
|
||||
default install path is fine. When it finishes, Battle.net will be in your
|
||||
app launcher.
|
||||
|
||||
EOF
|
||||
|
||||
log="/tmp/omarchy-battlenet-installer.log"
|
||||
setsid -f sh -c "umu-run '$installer' >'$log' 2>&1" </dev/null >/dev/null 2>&1
|
||||
echo "Installer log: $log"
|
||||
launched_installer=1
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.local/share/applications" "$HOME/.local/share/icons/hicolor/48x48/apps"
|
||||
install -m 644 "$HOME/.local/share/omarchy/applications/battlenet.desktop" \
|
||||
"$HOME/.local/share/applications/battlenet.desktop"
|
||||
install -m 644 "$HOME/.local/share/omarchy/applications/icons/Battle.net.png" \
|
||||
"$HOME/.local/share/icons/hicolor/48x48/apps/Battle.net.png"
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
|
||||
|
||||
if (( launched_installer )); then
|
||||
cat <<EOF
|
||||
|
||||
The Battle.net installer is running in the background. After it finishes,
|
||||
find Battle.net in your app launcher, or run:
|
||||
|
||||
omarchy-launch-battlenet
|
||||
|
||||
EOF
|
||||
else
|
||||
cat <<EOF
|
||||
|
||||
Battle.net is installed. Find it in your app launcher, or run:
|
||||
|
||||
omarchy-launch-battlenet
|
||||
|
||||
EOF
|
||||
fi
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Launch the installed Battle.net client via umu-launcher + GE-Proton.
|
||||
# omarchy:args=[--with-mangohud]
|
||||
# omarchy:examples=omarchy launch battlenet | omarchy launch battlenet --with-mangohud
|
||||
|
||||
set -e
|
||||
|
||||
PREFIX="$HOME/Games/battlenet"
|
||||
LAUNCHER="$PREFIX/drive_c/Program Files (x86)/Battle.net/Battle.net Launcher.exe"
|
||||
|
||||
with_mangohud=0
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--with-mangohud) with_mangohud=1 ;;
|
||||
-h|--help)
|
||||
cat <<'EOF'
|
||||
Usage: omarchy-launch-battlenet [--with-mangohud]
|
||||
|
||||
Options:
|
||||
--with-mangohud Enable the MangoHud FPS overlay for games launched from
|
||||
Battle.net. Toggle perf logging in-game with Shift_L+F2;
|
||||
CSV logs land in ~/mangohud/.
|
||||
EOF
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown argument: $arg" >&2
|
||||
echo "Try: omarchy-launch-battlenet --help" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ! -f "$LAUNCHER" ]]; then
|
||||
echo "Battle.net is not installed. Run omarchy-install-gaming-battlenet first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
env_args=(
|
||||
WINEPREFIX="$PREFIX"
|
||||
PROTONPATH=GE-Proton
|
||||
GAMEID=umu-battlenet
|
||||
PROTON_VERB=run
|
||||
)
|
||||
(( with_mangohud )) && env_args+=(MANGOHUD=1)
|
||||
|
||||
env "${env_args[@]}" umu-run "$LAUNCHER"
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Remove Battle.net, its Proton prefix, installed games, and desktop entry.
|
||||
|
||||
set -e
|
||||
|
||||
PREFIX="$HOME/Games/battlenet"
|
||||
|
||||
# Stop any running Battle.net / wine processes tied to this prefix.
|
||||
pkill -f "$PREFIX" 2>/dev/null || true
|
||||
sleep 1
|
||||
|
||||
rm -rf "$PREFIX"
|
||||
rm -f "$HOME/.local/share/applications/battlenet.desktop"
|
||||
rm -f "$HOME/.local/share/icons/hicolor/48x48/apps/Battle.net.png"
|
||||
rm -f "$HOME/.cache/omarchy/Battle.net-Setup.exe"
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
|
||||
|
||||
echo
|
||||
echo "Battle.net and its Proton prefix at $PREFIX have been removed."
|
||||
|
||||
if omarchy-pkg-present umu-launcher; then
|
||||
echo
|
||||
read -rp "Also remove umu-launcher? It's only used by this command. [y/N] " reply
|
||||
if [[ $reply =~ ^[Yy]$ ]]; then
|
||||
omarchy-pkg-drop umu-launcher
|
||||
fi
|
||||
fi
|
||||
|
||||
PROTON_DIR="$HOME/.local/share/Steam/compatibilitytools.d"
|
||||
if compgen -G "$PROTON_DIR/GE-Proton*" >/dev/null; then
|
||||
echo
|
||||
read -rp "Also remove GE-Proton runtimes downloaded by umu? [y/N] " reply
|
||||
if [[ $reply =~ ^[Yy]$ ]]; then
|
||||
rm -rf "$PROTON_DIR"/GE-Proton*
|
||||
rm -rf "$HOME/.local/share/umu"
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,16 @@
|
||||
-- Battle.net launches under Proton; all its windows share class steam_app_battlenet.
|
||||
|
||||
-- The actual launcher: float-centered.
|
||||
o.window({ class = "^steam_app_battlenet$", title = "^Battle\\.net$" }, {
|
||||
float = true,
|
||||
center = true,
|
||||
size = { 1280, 800 },
|
||||
})
|
||||
|
||||
-- Installer: drop decorations and backdrop blur/shadow so the Blizzard chrome
|
||||
-- isn't framed by the WM.
|
||||
o.window({ class = "^steam_app_battlenet$", title = "^Battle\\.net Setup$" }, {
|
||||
decorate = false,
|
||||
no_blur = true,
|
||||
no_shadow = true,
|
||||
})
|
||||
@@ -179,7 +179,7 @@
|
||||
"install.terminal": {"icon":"","label":"Terminal","keywords":"emulator"},
|
||||
"install.browser": {"icon":"","label":"Browser","keywords":"web"},
|
||||
"install.ai": {"icon":"","label":"AI","keywords":"dictation ollama lm studio crush"},
|
||||
"install.gaming": {"icon":"","label":"Gaming","keywords":"steam retroarch minecraft lutris heroic"},
|
||||
"install.gaming": {"icon":"","label":"Gaming","keywords":"steam battlenet retroarch minecraft lutris heroic blizzard"},
|
||||
"install.windows": {"icon":"","label":"Windows","keywords":"vm","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-windows-vm install'"},
|
||||
"install.browser.chrome": {"icon":"","label":"Chrome","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser chrome'"},
|
||||
"install.browser.edge": {"icon":"","label":"Edge","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser edge'"},
|
||||
@@ -215,7 +215,8 @@
|
||||
"install.gaming.xbox-cloud": {"icon":"","label":"Xbox Cloud Gaming","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-gaming-xbox-cloud"},
|
||||
"install.gaming.xbox-controller": {"icon":"","label":"Xbox Controller","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-gaming-xbox-controllers"},
|
||||
"install.gaming.moonlight": {"icon":"","label":"Moonlight (GameStream)","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-gaming-moonlight"},
|
||||
"install.gaming.lutris": {"icon":"","label":"Lutris (Battle.net)","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-gaming-lutris"},
|
||||
"install.gaming.battlenet": {"icon":"","label":"Battle.net","keywords":"blizzard wow overwatch diablo","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-gaming-battlenet"},
|
||||
"install.gaming.lutris": {"icon":"","label":"Lutris","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-gaming-lutris"},
|
||||
"install.gaming.heroic": {"icon":"","label":"Heroic (Epic Games)","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-gaming-heroic"},
|
||||
"install.gaming.retro-launcher": {"icon":"","label":"RetroArch Game Launcher","action":"omarchy-games-retro-install"},
|
||||
"install.development.rails": {"icon":"","label":"Ruby on Rails","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-dev-env ruby'"},
|
||||
@@ -268,7 +269,8 @@
|
||||
"remove.gaming.xbox-cloud": {"icon":"","label":"Xbox Cloud Gaming","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-gaming-xbox-cloud"},
|
||||
"remove.gaming.xbox-controller": {"icon":"","label":"Xbox Controller ()","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-gaming-xbox-controllers"},
|
||||
"remove.gaming.moonlight": {"icon":"","label":"Moonlight (GameStream)","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-gaming-moonlight"},
|
||||
"remove.gaming.lutris": {"icon":"","label":"Lutris (Battle.net)","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-gaming-lutris"},
|
||||
"remove.gaming.battlenet": {"icon":"","label":"Battle.net","when":"[[ -d $HOME/Games/battlenet ]]","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-gaming-battlenet"},
|
||||
"remove.gaming.lutris": {"icon":"","label":"Lutris","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-gaming-lutris"},
|
||||
"remove.gaming.heroic": {"icon":"","label":"Heroic (Epic Games)","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-gaming-heroic"},
|
||||
"remove.development.rails": {"icon":"","label":"Ruby on Rails","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-dev-env ruby'"},
|
||||
"remove.development.javascript": {"icon":"","label":"JavaScript","keywords":"node bun deno"},
|
||||
|
||||
Reference in New Issue
Block a user