You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shervin edited this page Jul 1, 2020
·
2 revisions
polybar-vpn-controller wiki
The module should be set up for Mullvad VPN users. For other VPN's, please check out these parameters in vpn_module.sh. Replacing the commands on the right with the appropriate calls from your VPN's API may suffice to swap VPN services.
## [Set VPN commands]. Setup for Mullvad is done below.
# The first three commands should have direct equivalents for most VPNs.
# The relay_set command assumes <country_code> <city_code> will follow as arguments. See below.
VPNCOMMAND_CONNECT="mullvad connect"
VPNCOMMAND_DISCONNECT="mullvad disconnect"
VPNCOMMAND_STATUS="mullvad status"
VPNCOMMAND_RELAY_SET_LOCATION="mullvad relay set location"
## [Set VPN status parsing]
# The first command cuts the status, which is compared to keywords below.
# TODO: Add community submissions for other VPNs to make this section robust!
VPN_STATUS="$($VPNCOMMAND_STATUS | cut -d' ' -f3)" # returns Connected/Connecting/<other>
CONNECTED=Connected
CONNECTING=Connecting
Feel free to open a pull request if you set up commands for other VPN's and want to see them incorporated in the Wiki or code itself.