System Utilities
Cross-platform utilities for interacting with operating system features such as audio control, power management, system information, hardware monitoring, and device enumeration.
Features:
- Audio management
- Power actions with optional timers
- System information
- Real-time system metrics monitoring
- Hardware device enumeration
- Cross-platform API (Windows, Linux, macOS where supported)
Installation
Examples:
System Monitoring [feature monitor]
SystemMonitor caches system information, metrics, and device lists internally.
Calling refresh_*_with_interval() updates the cached data only if the specified interval has elapsed,
reducing unnecessary operating system queries.
use SystemMonitor;
use Duration;
Basic System Info [feature info]
use SystemInfo;
System Metrics [feature metrics]
SystemMetrics::new() collects a complete snapshot of the current system state, including CPU, GPU, memory, disks, network interfaces,
proxy configuration, battery information (when available), and system uptime.
The returned snapshot is immutable and represents the system state at the moment it was created.
use SystemMetrics;
Devices List [feature devices]
DevicesList::new() creates a snapshot of the currently connected hardware devices, including monitors, audio devices, cameras, and USB devices.
The snapshot is immutable and reflects the hardware state at the time it was created.
use DevicesList;
Audio Control [feature audio]
SystemAudio provides a cross-platform API for controlling the system master volume.
It supports getting and setting the volume, increasing or decreasing it by a delta, and muting or unmuting the default audio output device.
use AudioControl;
async
Power Management [feature power]
SystemPower provides cross-platform power management, including shutdown, reboot, suspend, lock, and logout operations.
Every action can be executed immediately or scheduled for a future DateTime<Utc>.
Only one scheduled power action can be active at a time; scheduling a new action automatically replaces the previous one.
use ;
use PowerManager;
async
System Theme Switcher [feature theme]
A cross-platform utility for switching the system theme between Light and Dark modes on Linux, macOS and Windows through native operating system APIs.
use ;
async
License & Feedback:
Distributed under the MIT license.
You can contact me via GitHub or send a message to my E-Mail. This library is actively evolving, and your suggestions and feedback are always welcome!