BlackBox is a personal time black box recorder for Windows. It records foreground window activity into SQLite, then shows usage summaries from either the command line or a Qt desktop GUI.
Current status: early prototype, but already usable for local testing.
- Detect the active foreground window on Windows.
- Record activity segments into
blackbox.db. - Track idle periods.
- Show all-time and today's usage summaries.
- Provide both a CLI and a Qt Widgets desktop GUI.
Dependencies:
- Windows
- MSYS2 MinGW-w64 GCC
- CMake
- SQLite3
- Qt6 Widgets
With the MSYS2 MinGW64 toolchain:
cmake --preset mingw-gcc
cmake --build --preset mingw-gccThe included preset assumes the default MSYS2 location C:\msys64. If your
toolchain is installed elsewhere, create a local CMakeUserPresets.json and
override the paths there. This file is ignored by Git.
Print the current foreground window once:
.\build\blackbox.exe --onceStart recording from the command line:
.\build\blackbox.exe watch 1000Press Ctrl+C to stop watching.
Show reports:
.\build\blackbox.exe report
.\build\blackbox.exe report todayStart the desktop GUI:
.\build\blackbox_gui.exeBlackBox stores local activity data in blackbox.db. This file is ignored by
Git and should not be committed.
blackbox.exeis the command-line app.blackbox_gui.exeis the Qt desktop app.- Tests can be run with:
ctest --test-dir build --output-on-failureBlackBox is released under the MIT License.
BlackBox 是一个 Windows 个人时间黑盒记录器。它会把前台窗口活动记录到 SQLite 数据库中,然后通过命令行或 Qt 桌面 GUI 展示使用时间统计。
当前状态:早期原型,但已经可以用于本地测试。
- 检测 Windows 当前前台窗口。
- 将活动片段记录到
blackbox.db。 - 识别空闲状态。
- 展示全部时间和今日使用统计。
- 同时提供命令行版本和 Qt Widgets 桌面 GUI。
依赖:
- Windows
- MSYS2 MinGW-w64 GCC
- CMake
- SQLite3
- Qt6 Widgets
使用 MSYS2 MinGW64 工具链:
cmake --preset mingw-gcc
cmake --build --preset mingw-gcc仓库里的 preset 假设 MSYS2 安装在默认位置 C:\msys64。如果你的工具链路径不同,
可以创建本地 CMakeUserPresets.json 覆盖路径;这个文件已被 Git 忽略。
打印一次当前前台窗口:
.\build\blackbox.exe --once从命令行开始记录:
.\build\blackbox.exe watch 1000按 Ctrl+C 停止记录。
查看报告:
.\build\blackbox.exe report
.\build\blackbox.exe report today启动桌面 GUI:
.\build\blackbox_gui.exeBlackBox 会把本地活动数据存储到 blackbox.db。这个文件已经被 Git 忽略,
不应该提交到仓库。
blackbox.exe是命令行应用。blackbox_gui.exe是 Qt 桌面应用。- 测试命令:
ctest --test-dir build --output-on-failureBlackBox 使用 MIT License 开源。