home/natto/ags: fix weather

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-06-01 18:12:13 +05:30
parent f6f228f990
commit 5af717ac53
2 changed files with 4 additions and 1 deletions

View File

@@ -95,6 +95,9 @@
.weather { .weather {
color: $rosewater; color: $rosewater;
} }
& > * {
margin: 10px;
}
} }
.power-menu { .power-menu {

View File

@@ -47,7 +47,7 @@ export default () => {
}, },
Widget.Icon({ Widget.Icon({
icon: data.bind().as((d) => { icon: data.bind().as((d) => {
const condition = d?.["weatherDesc"]?.[0]?.["value"]; const condition = d?.["weatherDesc"]?.[0]?.["value"]?.split(/[\s,]+/)?.[0];
return `weather-${conditionIcons[condition]}-symbolic`; return `weather-${conditionIcons[condition]}-symbolic`;
}), }),
}), }),