diff --git a/applications/battlenet.desktop b/applications/battlenet.desktop new file mode 100644 index 00000000..ebd83692 --- /dev/null +++ b/applications/battlenet.desktop @@ -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 diff --git a/applications/icons/Battle.net.png b/applications/icons/Battle.net.png new file mode 100644 index 00000000..a18e41c7 Binary files /dev/null and b/applications/icons/Battle.net.png differ diff --git a/bin/omarchy-install-gaming-battlenet b/bin/omarchy-install-gaming-battlenet new file mode 100755 index 00000000..6283b3dc --- /dev/null +++ b/bin/omarchy-install-gaming-battlenet @@ -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 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 <&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" diff --git a/bin/omarchy-remove-gaming-battlenet b/bin/omarchy-remove-gaming-battlenet new file mode 100755 index 00000000..6b311b41 --- /dev/null +++ b/bin/omarchy-remove-gaming-battlenet @@ -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 diff --git a/default/hypr/apps/battlenet.lua b/default/hypr/apps/battlenet.lua new file mode 100644 index 00000000..13231d07 --- /dev/null +++ b/default/hypr/apps/battlenet.lua @@ -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, +}) diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 7b626f10..ae420f89 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -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"},