This document is for people who want to read the code or contribute small changes.
- usbscoped: daemon that tails kernel logs (
journalctl -k -f) and watchesudevfor device changes. Emits structuredUsbEventandUsbDeviceInfodata over D-Bus. - usbscope-ui: Qt6 desktop app that shows a log table, device list, and timeline view. Talks to the daemon over the
org.cachyos.USBscope1D-Bus interface. - usbscope-tray: system tray app that subscribes to error-related signals and surfaces notifications.
- usbscopecore: shared library with common types and D-Bus helpers used by the other components.
Dependencies: Qt6 (Core, Widgets, DBus), CMake, a C++17 compiler.
sudo pacman -S --needed cmake make gcc qt6-base qt6-tools
git clone https://github.com/infinityabundance/USBscope.git
cd USBscope
cmake -S . -B build
cmake --build buildThis produces binaries like build/usbscope-ui, build/usbscoped, and build/usbscope-tray.
From the repository root after building:
./build/usbscope-ui
./build/usbscoped
./build/usbscope-trayBy default the apps try to use the session D-Bus. You can force the system bus with:
USBSCOPE_BUS=system usbscope-ui
USBSCOPE_BUS=system usbscoped
USBSCOPE_BUS=system usbscope-traySystem bus use may require a suitable D-Bus policy.
- UI entry point:
MainWindowin the UI sources wires up the log table, filters, device list, and timeline view. TheTimelineView/TimelineScenefiles handle zooming, panning, and drawing. - D-Bus client and types: look for the D-Bus helper / client classes that expose
GetRecentEvents,GetCurrentDevices,GetStateSummary, and theLogEvent/DevicesChanged/ErrorBurstsignals. - Daemon: the
usbscopedsources contain the journald tailing andudevintegration logic that producesUsbEventand device snapshots.
Keeping changes focused and incremental makes review easier. Small, tightly scoped patches (bug fixes, small refactors, or local UI tweaks) are the easiest to land.