flathub / com.jagex.RuneScape

https://flathub.org/apps/details/com.jagex.RuneScape
20 stars 14 forks source link

Cannot override PULSE_LATENCY_MSEC environment variable #204

Closed nmlynch94 closed 1 year ago

nmlynch94 commented 1 year ago

From my understanding of this flatpak, there is a script called runescape which allows PULSE_LATENCY_MSEC to be overridden by an environment variable passed by the user. That script then calls runescape-launcher provided by the deb from Jagex.

At some point, they hard-coded an export of PULSE_LATENCY_MSEC=100, which breaks the user being able to override that to fix the cracking issue if 100 is not high enough. I confirmed that commenting out the export PULSE_LATENCY_MSEC=100 line inside of Jagex's runescape-launcher.sh allows the variable to be set again by the --env flag when running the flatpak.

runescape-launcher

#!/bin/sh

if [ -z $1 ]; then
    configURI=https://www.runescape.com/k=5/l=\$\(Language:0\)/jav_config.ws
else
    configURI=$1
    shift
fi

#export PULSE_PROP_OVERRIDE="application.name='RuneScape' application.icon_name='runescape' media.role='ga>
export SDL_VIDEO_X11_WMCLASS="RuneScape"
#I commented out the line below to fix the inhertance.
#export PULSE_LATENCY_MSEC=100

# Some older graphics drivers may require this to be uncommented, but it will restrict the available grap>
#export MESA_GL_VERSION_OVERRIDE=3.0

unset XMODIFIERS
/usr/share/games/runescape-launcher/runescape --configURI $configURI $@

I'm not familiar at all with how flatpaks work, but could it work to add another sed command to apply_extras.sh that can comment out the line exporting that variable?