refactor: reorganize components, add interface to network

This commit is contained in:
2025-06-28 01:49:02 -07:00
parent 78ca57e491
commit f6c13e0ec7
9 changed files with 155 additions and 130 deletions

16
astal/widget/ram.tsx Normal file
View File

@@ -0,0 +1,16 @@
import { bind, GLib, Variable } from "astal"
import { get_ram_info } from "./cpu"
let info = Variable(get_ram_info())
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {
info.set(get_ram_info())
return true
})
export default function Ram() {
return <box className="status-box">
<label label={bind(info).as((i) => `${Math.round((i.used / i.total) * 100)}% `)} />
</box>
}