feat: migrate to ags v3

This commit is contained in:
tux
2025-09-24 16:39:34 +05:30
parent 6437cad620
commit 9649ab0b6e
26 changed files with 330 additions and 451 deletions

View File

@@ -1,7 +1,7 @@
import { bind, Variable } from "astal";
import { createPoll } from "ags/time";
export const CPU = () => {
const cpu = Variable("").poll(5000, [
const cpu = createPoll("", 5000, [
"bash",
"-c",
"cat /sys/class/thermal/thermal_zone*/temp",
@@ -10,7 +10,7 @@ export const CPU = () => {
return (
<box cssClasses={["pill"]} spacing={5}>
<image iconName="fa-cpu-symbolic" />
<label label={bind(cpu).as((val) => `${parseInt(val) / 1000} °C`)} />
<label label={cpu((val) => `${parseInt(val) / 1000} °C`)} />
</box>
);
};