Remove protonvpn i3blocks script

This commit is contained in:
flyingscorpio@clevo 2022-02-11 19:54:27 +01:00
parent 67a1087e24
commit 10b2647efe
2 changed files with 0 additions and 36 deletions

View file

@ -346,9 +346,6 @@ i3blocks:
- symlink:
- dotfiles/i3/scripts/crypto
- ~/.config/i3blocks/scripts/crypto
- symlink:
- dotfiles/i3/scripts/protonvpn
- ~/.config/i3blocks/scripts/protonvpn
- symlink:
- ~/.git_clones/i3blocks-contrib/calendar/calendar
- ~/.config/i3blocks/scripts/calendar

View file

@ -1,33 +0,0 @@
#!/usr/bin/env python3
"""Simple script for i3blocks for VPN status with ProtonVPN.
Author: flyingscorpio
"""
import os
import subprocess
from protonvpn_cli import utils as pvpn_utils # type: ignore
if os.environ.get("BLOCK_BUTTON") is not None:
vpn_command = subprocess.run(
"sudo protonvpn r", check=True, shell=True
)
IP_ADDR = pvpn_utils.get_ip_info()[0]
if not pvpn_utils.is_connected():
OUTPUT = os.environ["LABEL_OFF"]
OUTPUT += " {}".format(IP_ADDR)
else:
SERVER = pvpn_utils.get_config_value("metadata", "connected_server")
ALL_SERVERS = pvpn_utils.get_servers()
CODE = pvpn_utils.get_server_value(SERVER, "ExitCountry", ALL_SERVERS)
COUNTRY = pvpn_utils.get_country_name(CODE)
CITY = pvpn_utils.get_server_value(SERVER, "City", ALL_SERVERS)
OUTPUT = os.environ["LABEL_ON"]
OUTPUT += " {} - {}, {}".format(IP_ADDR, CITY, COUNTRY)
print(OUTPUT)