Skip to content

Instantly share code, notes, and snippets.

@sthesing
Created November 9, 2017 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sthesing/21ef9de88c0cc84253c1f158f24a6be5 to your computer and use it in GitHub Desktop.
Save sthesing/21ef9de88c0cc84253c1f158f24a6be5 to your computer and use it in GitHub Desktop.
Argos script to restart networking with a click
#!/usr/bin/env python3
# License: WTFPL
import subprocess
status = subprocess.check_output(["nmcli", "networking", "connectivity"]).decode()
# replace "vollständig" with whatever nmcli outputs for "full" in your language setting
if status == "vollständig\n":
icon = "<span color='green'><tt>✓</tt></span>"
else:
icon = "<span color='red'><tt>✗</tt></span>"
message = icon or "Restart Network"
print("🖧: ", message)
print("---")
print("Status: ", status)
print("Restart Network | iconName=view-refresh bash='nmcli networking off && nmcli networking on' terminal=false")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment