Skip to content

Instantly share code, notes, and snippets.

@derek-shnosh
Created December 24, 2025 00:00
Show Gist options
  • Select an option

  • Save derek-shnosh/c6ee3344ada468f5cd0069f96301d95d to your computer and use it in GitHub Desktop.

Select an option

Save derek-shnosh/c6ee3344ada468f5cd0069f96301d95d to your computer and use it in GitHub Desktop.
Workaround for ProtonVPN GTK app crashing when launched in non-interactive or "headless" contexts (SSH, RDP, etc).
#!/usr/bin/env bash
set -euo pipefail
FILE="/usr/lib/python3/dist-packages/proton/vpn/app/gtk/services/reconnector/session_monitor.py"
# Require root
if [[ $EUID -ne 0 ]]; then
echo "Run as root (sudo)." >&2
exit 1
fi
# Ensure file exists
if [[ ! -f "$FILE" ]]; then
echo "File not found: $FILE" >&2
exit 1
fi
# Skip if already patched
if grep -q "#seat_properties = seat_auto_properties_proxy.GetAll(SEAT_INTERFACE)" "$FILE"; then
echo "Already patched. Nothing to do."
exit 0
fi
# Apply patch
sed -i \
'/^[[:space:]]*seat_properties = seat_auto_properties_proxy.GetAll(SEAT_INTERFACE)/{
s/^\([[:space:]]*\)/\1#/
a\
try:\
seat_properties = seat_auto_properties_proxy.GetAll(SEAT_INTERFACE)\
except Exception:\
# no /seat/auto in headless sessions - skip reconnect logic\
return
}' \
"$FILE"
echo "Patch applied successfully."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment