How kbumsik/virtscreen works
Main Components
• User Interface (GUI) Component:
• Represents the primary interaction layer with the user.
• Includes the PyQt5-based system tray app and QML-defined windows (assets directory with AppWindow.qml, DisplayOptionsDialog.qml, etc.).
• Command-Line Interface (CLI) Component:
• Provides a way to start/configure the virtual screen without the GUI.
• Tied into the same backend methods as the GUI, sharing common configurations.
• Virtual Screen Manager:
• Core logic for creating and controlling the virtual screen.
• Modules include display.py, process.py, and qt_backend.py, which orchestrate the functionality.
• The xrandr.py module likely handles screen configuration using XRandR.
• External Dependencies and Services:
• The project uses external tools like x11vnc to serve the virtual screen as a VNC session.
• XRandR is used to manage the display properties of the virtual screen.
• Packaging/Deployment Layer:
• Contains distribution and packaging scripts (e.g., AppImage, Debian, ArchLinux, and PyPI packaging under the package directory).
• Dockerfile, Makefile, and CI configuration (.travis.yml) further support building and deploying the application.
Relationships and Interactions
• The UI (GUI and CLI) receives user inputs or arguments and communicates with the Virtual Screen Manager.
• The Virtual Screen Manager uses xrandr to configure the virtual display and initiates x11vnc to broadcast the new screen.
• Communication between the GUI front-end and the logic layer might be mediated by asyncio’s event loop, ensuring asynchronous operations.
• Packaging tools and configuration files are used mainly during build and deployment; they do not directly interact with the runtime architecture but are important for distribution considerations.
Architectural Patterns and Design Principles
• Separation of Concerns: The project is cleanly separated into the front-end (UI), core logic (virtual screen management), and system integrations (xrandr, x11vnc).
• Modularization: Distinct modules (display.py, xrandr.py, process.py, qt_backend.py) manage their respective responsibilities.
• Extensibility: A well-defined packaging layer shows that the project is designed to be built, deployed, and installed in multiple formats across different Linux distributions.
3. From the Virtual Screen Manager, add connections indicating calls to external components:
• Another to the “x11vnc Service” (to start the VNC server).
4. An annotation near this central block that mentions the use of asyncio for asynchronous event handling.