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:
|
||||
icon = ""
|
||||
|
||||
content = f"{icon}{status}%"
|
||||
content = f"{icon}{charge}%"
|
||||
except Exception:
|
||||
content = None
|
||||
|
|
|
@ -7,7 +7,7 @@ dbmRange = {(-10, ""), (-70, ""), (-80, ""), (-90, "")}
|
|||
# full data
|
||||
try:
|
||||
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")
|
||||
|
||||
status = {}
|
||||
|
@ -20,7 +20,7 @@ try:
|
|||
case l if l.startswith("State"):
|
||||
status["state"] = l.split()[1]
|
||||
case l if l.startswith("Connected network"):
|
||||
status["SSID"] = l.split()[2:]
|
||||
status["SSID"] = ' '.join(l.split()[2:])
|
||||
case l if l.startswith("Frequency"):
|
||||
f = int(l.split()[1])
|
||||
if f >= 5925:
|
||||
|
|
Loading…
Add table
Reference in a new issue