diff --git a/.config/eww/scripts/network.py b/.config/eww/scripts/network.py index 99db78e..3ed863f 100755 --- a/.config/eww/scripts/network.py +++ b/.config/eww/scripts/network.py @@ -92,7 +92,7 @@ class Interface: def get_first_hop() -> IPAddress | None: """Get the first network hop.""" # Use ping to get the first hop - cmd = ["/usr/bin/ping", "-c1", "-W0.3", "-t1", "1.1.1.1"] + cmd = ["ping", "-c1", "-W0.3", "-t1", "1.1.1.1"] result = run(cmd, stdout=PIPE, stderr=PIPE) try: ip = IPAddress(result.stdout.decode("utf-8").split("\n")[1].split()[1]) @@ -145,14 +145,14 @@ def interface_status(interface: str, gw): def ping(host: IPAddress) -> bool: - cmd = ["/usr/bin/ping", "-c1", "-w1", str(host)] + cmd = ["ping", "-c1", "-w1", str(host)] result = run(cmd, stdout=DEVNULL, stderr=DEVNULL) return result.returncode == 0 def get_public_ip(): """Get the public IP address.""" - cmd = ["/usr/bin/curl", "-s", "https://ipinfo.io"] + cmd = ["curl", "-s", "https://ipinfo.io"] result = run(cmd, stdout=PIPE, stderr=PIPE) try: data = json.loads(result.stdout.decode("utf-8")) @@ -171,7 +171,7 @@ def get_public_ip(): def get_default_route(): """Get the default route.""" - cmd = ["/usr/bin/ip", "route", "show", "default"] + cmd = ["ip", "route", "show", "default"] result = run(cmd, stdout=PIPE, stderr=PIPE) try: # Get first line (might have multiple gateway routes)