feat: add ujust to toggle Gnome JS JIT (#344)

* Add ujust to toggle Gnome JS JIT

* Disable Gnome JIT by default
This commit is contained in:
Root
2024-07-29 00:48:48 -04:00
committed by GitHub
parent abcdd4e3ac
commit 1a55f1549b
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
export JavaScriptCoreUseJIT=0
export GJS_DISABLE_JIT=1

View File

@@ -177,3 +177,15 @@ toggle-anticheat-support:
else
echo "The sysctl hardening file is missing the ptrace_scope setting."
fi
# Toggle Gnome JIT JavaScript for GJS and WebkitGTK (requires session restart)
toggle-gnome-jit-js:
#!/usr/bin/pkexec /usr/bin/bash
ENV_FILE="/etc/profile.d/gnome-disable-jit.sh"
if test -e $ENV_FILE; then
sudo rm -f $ENV_FILE
echo "JIT has been enabled."
else
sudo sh -c 'echo -e "export JavaScriptCoreUseJIT=0\nexport GJS_DISABLE_JIT=1" > /etc/profile.d/gnome-disable-jit.sh'
echo "JIT has been disabled."
fi