The concept is straightforward: subscribe to relevant events (e.g., system startup, screen unlock) to reapply, reset, or reconnect critical system settings and ensure everything runs smoothly. When my laptop comes back from sleep the VPN connection is lost, it can't reconnect. Detecting when it comes back, killing VPN and restarting it solves the problem
The next script is generated by Tape That Moth (TTM) to solve the issue
#!/usr/bin/env bash
while read -r line; do
case "$line" in
*"{'Active': <true>}"*) /some/path/to/proton-vpn-restart ;;
esac
done < <(gdbus monitor -y -d org.freedesktop.login1)
Where /some/path/to/proton-vpn-restart, not generated by TTM, kills VPN and starts a new one
#!/usr/bin/env bash
pkill -9 -f protonvpn-app
python3 /usr/bin/protonvpn-app >/dev/null 2>&1 &
This approach may not adhere to traditional coding best practices, but it's a pragmatic solution that yields results
#Linux #FOSS #OpenSource #UX #SystemFixes #TapeThatMoth #DesktopTools #BugWorkarounds