Skip to content

Instantly share code, notes, and snippets.

@kevinlekiller
Last active September 13, 2022 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinlekiller/33be65aefaccdfffe896c2d8deac282a to your computer and use it in GitHub Desktop.
Save kevinlekiller/33be65aefaccdfffe896c2d8deac282a to your computer and use it in GitHub Desktop.
Download RuneScape 3 launcher and sandbox it with firejail, with vkBasalt on top.
#!/bin/bash
# GPLv2
# Start like this to update RuneScape launcher: UPDATE_RUNESCAPE=1 ./run.sh
#--------------------------------------------
WD=$(realpath "$(dirname "$0")")
runescape=$(realpath "$WD/runescape")
UPDATE_RUNESCAPE=${UPDATE_RUNESCAPE:-0}
if [[ ! $UPDATE_RUNESCAPE -eq 0 ]]; then
rm -f "$runescape"
fi
if [[ ! -f $runescape ]]; then
echo "Updating Runescape."
tmpdir=/tmp/runescape-launcher
rm -rf "$tmpdir"
mkdir -p "$tmpdir" || exit 1
cd "$tmpdir" || exit 1
curl -Ls -o runescape.PKGBUILD "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=runescape-launcher" || exit 1
pkgver=$(grep ^pkgver runescape.PKGBUILD | cut -d= -f2)
[[ -z $pkgver ]] && exit 1
pkgname=$(grep ^pkgname runescape.PKGBUILD | cut -d= -f2)
[[ -z $pkgname ]] && exit 1
curl -Ls -o runescape-launcher.deb "https://content.runescape.com/downloads/ubuntu/pool/non-free/r/$pkgname/${pkgname}_${pkgver}_amd64.deb" || exit 1
7z x runescape-launcher.deb || exit 1
tar -xf data.tar || exit 1
cd "$WD" || exit 1
mv "$tmpdir"/usr/share/games/runescape-launcher/runescape . || exit 1
rm -rf "$tmpdir"
fi
chmod u+x "$runescape"
ENABLE_VKBASALT=1 MANGOHUD=1 VKBASALT_CONFIG_FILE=~/.config/vkBasalt/vkBasaltRuneScape.conf gamescope --fullscreen -- \
firejail --nogroups --nodbus --nou2f --private-dev --private-tmp --seccomp \
--whitelist=~/.runescape --noblacklist=~/.runescape \
--whitelist=~/Jagex --noblacklist=~/Jagex \
--whitelist="$WD" --noblacklist="$WD" \
--env=PULSE_LATENCY_MSEC=128 "$runescape"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment