mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 14:23:51 +02:00
Restart wine Discord RPC bridge when it crashes
Co-Authored-By: rs189 <35667100+rs189@users.noreply.github.com>
This commit is contained in:
21
Linux/vrcx
21
Linux/vrcx
@@ -2,22 +2,39 @@
|
||||
|
||||
export WINEPREFIX=~/.local/share/vrcx
|
||||
|
||||
wine ~/.local/share/vrcx/drive_c/winediscordipcbridge.exe &
|
||||
IPCBRIDGE_PID=$!
|
||||
# Function to launch winediscordipcbridge
|
||||
launch_ipcbridge() {
|
||||
wine ~/.local/share/vrcx/drive_c/winediscordipcbridge.exe &
|
||||
IPCBRIDGE_PID=$!
|
||||
}
|
||||
|
||||
# Launch winediscordipcbridge
|
||||
launch_ipcbridge
|
||||
|
||||
# Launch VRCX
|
||||
wine ~/.local/share/vrcx/drive_c/vrcx/VRCX.exe &
|
||||
VRCX_PID=$!
|
||||
|
||||
while kill -0 $VRCX_PID 2>/dev/null; do
|
||||
# Check if VRChat is running
|
||||
if ps -A | grep -i "VRChat.exe" > /dev/null; then
|
||||
isGameRunning=true
|
||||
else
|
||||
isGameRunning=false
|
||||
fi
|
||||
echo "isGameRunning=$isGameRunning" > "$WINEPREFIX/drive_c/users/$USER/AppData/Roaming/VRCX/wine.tmp"
|
||||
|
||||
# Check if winediscordipcbridge is running
|
||||
if ! kill -0 $IPCBRIDGE_PID 2>/dev/null; then
|
||||
echo "winediscordipcbridge.exe not running, restarting..."
|
||||
launch_ipcbridge
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Cleanup after VRCX exits
|
||||
echo "isGameRunning=false" > "$WINEPREFIX/drive_c/users/$USER/AppData/Roaming/VRCX/wine.tmp"
|
||||
|
||||
# Kill winediscordipcbridge if it's still running
|
||||
kill $IPCBRIDGE_PID 2>/dev/null
|
||||
Reference in New Issue
Block a user