A high-performance, Wayland-compatible WLX (Lister) log viewer plugin for Double Commander, built with Qt6 and C++20. Designed specifically to handle large log files seamlessly while providing fast searching and filtering capabilities without freezing the host application.
- Zero-Copy File Loading: Utilizes
mmapand line-offset indexing to instantly load massive log files with extremely low memory overhead. - Fast Regex Searching: Powered by Google's
RE2regex engine. Searches are offloaded to a backgroundstd::jthreadto keep the UI fully responsive. - Timestamp Range Filtering: Automatically detects and parses common timestamp formats (ISO 8601, nginx, syslog). Allows filtering log lines within a specific date/time range.
- Live Tailing (Follow Mode): Monitors the file for changes using
QFileSystemWatcher(inotify-based) and automatically updates and scrolls to new entries. - Advanced Filtering: Implements
QSortFilterProxyModelfor combining regex matches and timestamp ranges efficiently. - Native Interactions: Supports standard file manager interactions, including multi-row selection (Ctrl+click, Shift+click) and copying (Ctrl+C, Right-click context menu).
- Wayland Focus Isolation: Implements a robust 4-layer focus defense architecture to resolve Wayland focus-hijacking bugs typical when embedding Qt components into Lazarus applications:
- Layer 0: Deferred
show()execution to prevent the plugin from trapping the host'sMouseReleaseevent (fixes the "phantom-drag" issue). - Layer 1: Aggressive
Qt::NoFocuspolicy applied to the base container. - Layer 2: Recursive focus guard that strips focus capabilities from all non-input child widgets.
- Layer 3: Cross-load focus preservation (saves the currently focused Double Commander widget state and restores it after loading completes).
- Layer 4: Global
FocusInevent interceptor that immediately yanks stolen focus back to Double Commander, unless an input field is explicitly clicked by the user.
- Layer 0: Deferred
To build this plugin, the following packages and libraries are required:
- C++20 compatible compiler (GCC or Clang)
- CMake (3.16 or higher)
- Qt 6 development packages (Core, Gui, Widgets)
- RE2 regular expression library (
libre2-devon Debian/Ubuntu)
- Clone or navigate to the plugin directory.
- Create a build directory and configure with CMake:
mkdir build cd build cmake .. - Compile the plugin:
make -j$(nproc) - Install the compiled
.wlxfile to your Double Commander WLX plugins directory:cp logviewer_wlx.wlx ~/.config/doublecmd/plugins/wlx/
- Open Double Commander.
- Go to Configuration > Options > Plugins > WLX (Lister).
- Click Add and select the installed
logviewer_wlx.wlxfile. - The plugin automatically registers the following extensions:
.log,.out,.err,.ndjson,.jsonl,.1,.2, and.old. You can adjust this "Detect string" in Double Commander's options if you want it to automatically trigger on other extensions. - Apply and close. Select a log file and press
F3orCtrl+Q(Quick View) to use. For files without an extension (like/var/log/syslog), select the file and pressF3.
