/ de-omarchy / bin / omarchy-launch-battlenet
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
49 lines · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/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"