Fix battery and wifi code via actual outputs
This commit is contained in:
parent
6837265efe
commit
f70a028a10
2 changed files with 3 additions and 3 deletions
|
@ -9,6 +9,6 @@ try:
|
||||||
else:
|
else:
|
||||||
icon = ""
|
icon = ""
|
||||||
|
|
||||||
content = f"{icon}{status}%"
|
content = f"{icon}{charge}%"
|
||||||
except Exception:
|
except Exception:
|
||||||
content = None
|
content = None
|
||||||
|
|
|
@ -7,7 +7,7 @@ dbmRange = {(-10, ""), (-70, ""), (-80, ""), (-90, "")}
|
||||||
# full data
|
# full data
|
||||||
try:
|
try:
|
||||||
data = subprocess.run(
|
data = subprocess.run(
|
||||||
["iwd", "station", "wlan0", "show"], stdout=subprocess.PIPE, encoding="utf-8"
|
["iwctl", "station", "wlan0", "show"], stdout=subprocess.PIPE, encoding="utf-8"
|
||||||
).stdout.split("\n")
|
).stdout.split("\n")
|
||||||
|
|
||||||
status = {}
|
status = {}
|
||||||
|
@ -20,7 +20,7 @@ try:
|
||||||
case l if l.startswith("State"):
|
case l if l.startswith("State"):
|
||||||
status["state"] = l.split()[1]
|
status["state"] = l.split()[1]
|
||||||
case l if l.startswith("Connected network"):
|
case l if l.startswith("Connected network"):
|
||||||
status["SSID"] = l.split()[2:]
|
status["SSID"] = ' '.join(l.split()[2:])
|
||||||
case l if l.startswith("Frequency"):
|
case l if l.startswith("Frequency"):
|
||||||
f = int(l.split()[1])
|
f = int(l.split()[1])
|
||||||
if f >= 5925:
|
if f >= 5925:
|
||||||
|
|
Loading…
Add table
Reference in a new issue