How vijaidjearam/uwf-monitor works
Purpose and Entry Point
This is a Windows-only, background system-tray monitor for Unified Write Filter (UWF). Its sole application entry point is uwf_tray_monitor.py, which is run directly with Python or packaged as a windowless executable.
Application Shell and UI
uwf_tray_monitor.py hosts the PyQt5 application lifecycle and system-tray integration. It creates a tray icon, maintains tooltip text, and exposes a context menu for manual refresh, detailed UWF information, and exit. There is no web server, persistent datastore, or multi-process application backend.
UWF Status Collection
The monitor invokes the Windows UWF management CLI, uwfmgr.exe, through subprocess calls:
• uwfmgr.exe get-config determines whether the filter is enabled.
• uwfmgr.exe volume get-config c: determines whether the C: volume is protected.
These commands require Windows 10/11 with UWF installed and normally administrator privileges. Their UTF-16 output is decoded before status parsing. Console-suppression flags prevent command windows from appearing.
Status Evaluation Boundary
Within uwf_tray_monitor.py, command output is parsed into two independent signals: filter state and volume-protection state. The overall protected state is true only when both are true; failures, disabled filter state, or an unprotected C: volume resolve to the unprotected condition. This keeps external CLI output isolated from UI state.
Refresh and Control Flow
A periodic Qt timer triggers status collection every five seconds. The same refresh path is reused by the context-menu refresh action. The resulting state updates the tray icon color and tooltip; detailed-status UI uses the collected configuration information. Exit terminates the Qt event loop and monitor process.
Runtime and Packaging
The runtime is Python 3.7+ on Windows with PyQt5, declared in requirements.txt. The intended deployment artifact is a PyInstaller one-file, windowless executable built from uwf_tray_monitor.py. GitHub Actions release automation is defined in .github/workflows/build-release.yml, likely providing the build/release boundary for distributable binaries.
Main entry points: uwf_tray_monitor.py UWF status collection · requirements.txt Python dependencies · build-release.yml Release build workflow
Components 15
Windows Runtime
Windows 10/11 host with UWF installed.
- Windows 10/11 + UWF · UWF commands normally require administrator privileges.
- uwfmgr.exe
Tray Monitor
- Application entry point · Hosts the PyQt lifecycle and monitor process.
uwf_tray_monitor.py - Periodic refresh timer · Triggers collection every five seconds.
uwf_tray_monitor.py - System tray UI · Provides icon, tooltip, and context menu.
uwf_tray_monitor.py - Manual refresh action
uwf_tray_monitor.py - UWF status collection · Runs hidden CLI commands and decodes UTF-16 output.
uwf_tray_monitor.py - Filter configuration · Collected with get-config.
uwf_tray_monitor.py - C: volume configuration · Collected with volume get-config c:.
uwf_tray_monitor.py - Protection state evaluation · Protected only when filter and C: protection are both enabled.
uwf_tray_monitor.py - Detailed status UI · Shows collected UWF configuration information.
uwf_tray_monitor.py - Exit action · Terminates the Qt event loop.
uwf_tray_monitor.py
Build & Release
- Python dependencies · Declares Python 3.7+ and PyQt5 requirements.
requirements.txt - PyInstaller executable · One-file, windowless Windows executable.
uwf_tray_monitor.py - Release build workflow · Builds and releases distributable binaries.
.github/workflows/build-release.yml
Connections 19
- Windows 10/11 + UWF → uwfmgr.exe: provides
- Application entry point → System tray UI: creates
- Application entry point → Periodic refresh timer: starts
- Periodic refresh timer → UWF status collection: every 5 seconds
- Manual refresh action → UWF status collection: reuses refresh path
- System tray UI → Manual refresh action: exposes
- UWF status collection → uwfmgr.exe: invokes subprocess commands
- UWF status collection → Filter configuration: get-config
- UWF status collection → C: volume configuration: volume get-config c:
- Filter configuration → Protection state evaluation: filter signal
- C: volume configuration → Protection state evaluation: volume signal
- Protection state evaluation → System tray UI: updates icon and tooltip
- UWF status collection → Detailed status UI: supplies configuration
- System tray UI → Detailed status UI: opens
- System tray UI → Exit action: exposes
- Exit action → Application entry point: stops event loop
- Python dependencies → Application entry point: supplies PyQt5 runtime
- Application entry point → PyInstaller executable: packaged as
- Release build workflow → PyInstaller executable: builds and releases