Vấn đề thực tế
Khi chơi game trên handheld PC như Steam Deck, ROG Ally, Legion Go, mình muốn biết ngay: CPU đang ngốn bao nhiêu W, pin còn bao lâu, WiFi có ổn không. Mấy tool có sẵn như HWiNFO hay MSI Afterburner nặng quá, hoặc OSD che mất game.
Widget này giải quyết đúng bài toán đó — script PowerShell khoảng 77KB, dùng WPF để vẽ giao diện. Hiển thị đúng thông số cần thiết, không che game, không có background service nặng.
Tính năng
System metrics
CPU power (W)khi hardware sensor hỗ trợ (LibreHardwareMonitor)
Battery drain / charging (W) + ETA thời gian còn lại
WiFi SSID + Network online/offline state
Download / Upload speed real-time (smoothing để tránh nhảy số)
UI / UX
Floating widget UInổi trên desktop, không che game
Compact modechỉ battery + network, khi chơi game
Full modeđầy đủ metrics
Tray icon với show/hide, custom app icon (EXE + tray + taskbar)
Auto-start with Windows (toggle trong config)
Tech stack
Build hoàn toàn bằng công cụ native Windows, không cần cài thêm runtime ngoài PowerShell có sẵn.
// PowerShell 5+
// WPF
// LibreHardwareMonitor
// ps2exe
// ~77KB script
// 1500ms refresh (default)
Cách dùng
- Mở PowerShell, vào folder repo
- Chạy:
powershell -NoProfile -ExecutionPolicy Bypass -Sta -File .\TdpDrainWidget.ps1 - Hoặc double-click
Launch-TdpDrainWidget.cmd - Build EXE:
Install-Module ps2exe -Scope CurrentUserrồi.\scripts\Build-SystemMonitorExe.ps1
💡 TIP: Nếu CPU power hiện 0, cần cài LibreHardwareMonitor hoặc một trong các tool có bundle DLL: RivaTuner Statistics Server, Handheld Companion. Widget tự động detect DLL từ common paths.
Project layout
.
├── assets/
│ ├── SystemMonitor.ico — Icon cho EXE, tray, taskbar
│ └── SystemMonitor.png
├── dist/ — Output sau build
├── scripts/
│ └── Build-SystemMonitorExe.ps1
├── Launch-TdpDrainWidget.cmd
├── README.md
└── TdpDrainWidget.ps1 — Main script 77KB
Roadmap
✅ Done
Core widget + system metricsCPU power, battery, network, WiFi SSID, download/upload speed
2026-03✅ Done
Tray icon + show/hide controlCustom icon, show/hide/exit menu
2026-03✅ Done
Build EXE pipelineps2exe + custom icon, no console, DPI-aware, single file
2026-03✅ Done
Compact / Full modeToggle hiển thị tùy nhu cầu
2026-03🔧 WIP
GPU power + temperatureHiện chỉ có CPU power — muốn thêm GPU để monitor khi chơi game
—📋 Planned
Sparkline history (50s)Biểu đồ mini cho CPU/GPU power
—📋 Planned
Theme color sync theo performance modeĐổi màu widget theo Balanced/Turbo/Silent
—Hạn chế đã biết
CPU power = 0 trên một số PC — phụ thuộc hardware sensor
Battery data chỉ có trên thiết bị có pin
Chưa monitor GPU (chỉ có CPU hiện tại)
Network speed có thể lag 1-2s do query mỗi cycle