feat: update system

This commit is contained in:
2024-02-07 14:25:34 +01:00
parent 3bfeb8e6fc
commit 09afd0bef6
67 changed files with 933 additions and 1347 deletions

View File

@@ -13,23 +13,16 @@ const SysProgress = (type, title, unit) =>
Widget.Box({
class_name: `circular-progress-box ${type}`,
hexpand: true,
binds: [
[
"tooltipText",
vars[type],
"value",
(v) => `${title}: ${Math.floor(v * 100)}${unit}`,
],
],
tooltip_text: vars[type]
.bind("value")
.transform((v) => `${title}: ${Math.floor(v * 100)}${unit}`),
child: Widget.CircularProgress({
hexpand: true,
class_name: `circular-progress ${type}`,
child: Widget.Icon(icons.system[type]),
start_at: 0.75,
binds: [
["value", vars[type]],
["rounded", options.radii, "value", (v) => v > 0],
],
value: vars[type].bind(),
rounded: options.radii.bind("value").transform((v) => v > 0),
}),
});
@@ -45,7 +38,7 @@ export default () =>
Clock({ format: "%H:%M" }),
Widget.Label({
class_name: "uptime",
binds: [["label", vars.uptime, "value", (t) => `uptime: ${t}`]],
label: vars.uptime.bind("value").transform((t) => `uptime: ${t}`),
}),
],
}),