This script manages virtual screens in a multi-display setup using xrandr
. It extracts and processes information from the DRM subsystem via drm_info
and updates configuration files in JSON format with details of the connected screens.
The script performs dynamic checks and updates the configuration based on the available screens, connectors, and cards.
- Automatically detects and enables virtual screens based on a predefined configuration.
- Updates screen information using
xrandr
anddrm_info
. - Writes details of each enabled screen (including CRTC IDs and plane IDs) to a JSON file for further use.
- Clears and regenerates output configuration files with each run.
The following tools are required to run this script:
- bash: Command-line interpreter.
- xrandr: Utility to manage screen output in X server.
- jq: JSON processing utility.
- drm_info: Command-line tool to retrieve detailed information about DRM (Direct Rendering Manager) devices.
IMPORTANT:
This script is designed for Arch Linux and has only been tested on Arch Linux.
- Create a Zaphodhead configuration for xorg (e.g.,
zaphodhead-xorg.conf
). - Place the
zaphodhead-xorg.conf
file into/etc/X11/xorg.conf.d/
.
Make sure to rename it toxorg.conf
.
If your display manager does not start with this xorg.conf
, you may need to remove the configuration file.
To do this:
- Reboot your system and press
Ctrl+Alt+F2
to enter tty mode (a text-based terminal). - Log in to your system.
- Navigate to
/etc/X11/xorg.conf.d/
and delete thexorg.conf
file.
One of the issues encountered is that the GPU is sometimes detected as /dev/dri/card1
instead of /dev/dri/card0
, which prevents screens from initializing properly. None of the driver versions, including specifying modules like amdgpu
and radeon
, could solve this issue.
Here is the ticket and solution I found: Arch Linux Forum Discussion. The solution involves adding the kernel parameter:
initcall_blacklist=simpledrm_platform_driver_init
- This repository is part of Pixel Cloud Project