Fix battery and wifi code via actual outputs

This commit is contained in:
JLP 2025-07-01 19:18:14 -04:00
parent 6837265efe
commit f70a028a10
Signed by: jleechpe
GPG key ID: 414E00D1FF7519DC
2 changed files with 3 additions and 3 deletions

View file

@ -9,6 +9,6 @@ try:
else:
icon = "󰂄"
content = f"{icon}{status}%"
content = f"{icon}{charge}%"
except Exception:
content = None

View file

@ -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: