Created
November 9, 2017 19:32
-
-
Save sthesing/21ef9de88c0cc84253c1f158f24a6be5 to your computer and use it in GitHub Desktop.
Argos script to restart networking with a click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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