Subscribes to system and hardware information streamed from the Fluxlay desktop app. Useful for building cyberpunk HUDs, system monitor wallpapers, and hardware-reactive visuals.
Import
import { useSystemMonitor } from "@fluxlay/react";
Signature
function useSystemMonitor(options?: SystemMonitorOptions): SystemMonitorInfo;
Parameters
SystemMonitorOptions
Per-category polling intervals in milliseconds. Omitted fields use their default values.
Property
Type
Default
Description
cpuIntervalMs
number
500
CPU usage, per-core usage, and frequency.
memoryIntervalMs
number
1000
Memory and swap usage.
networkIntervalMs
number
1000
Network receive/transmit speed.
diskIoIntervalMs
number
2000
Disk read/write speed.
diskSpaceIntervalMs
number
30000
Disk capacity per mount point.
batteryIntervalMs
number
10000
Battery level and charging status.
processIntervalMs
number
10000
Running process count.
loadAverageIntervalMs
number
5000
System load average.
Shorter intervals increase responsiveness but also increase CPU usage. Adjust the balance to suit your wallpaper's needs.
Return Value
CPU
Property
Type
Description
cpuUsage
number
Overall CPU usage percentage (0.0 – 100.0).
cpuPerCore
number[]
Per-core usage percentages (0.0 – 100.0 each).
cpuFrequencyMhz
number[]
Per-core clock frequency in MHz.
Memory
Property
Type
Description
memoryTotal
number
Total physical memory in bytes.
memoryUsed
number
Used physical memory in bytes.
memoryUsage
number
Memory usage percentage (0.0 – 100.0).
swapTotal
number
Total swap space in bytes.
swapUsed
number
Used swap space in bytes.
swapUsage
number
Swap usage percentage (0.0 – 100.0).
Battery
Property
Type
Description
batteryLevel
number | null
Battery charge level (0.0 – 100.0), or null if no battery is present.
batteryCharging
boolean | null
Whether the battery is currently charging, or null if no battery.