feat: add display server detection to osInfo()#1020
Open
KristjanESPERANTO wants to merge 1 commit intosebhildebrandt:masterfrom
Open
feat: add display server detection to osInfo()#1020KristjanESPERANTO wants to merge 1 commit intosebhildebrandt:masterfrom
KristjanESPERANTO wants to merge 1 commit intosebhildebrandt:masterfrom
Conversation
Adds displayServer field to detect which graphical display server is currently active. This helps identify the graphics stack being used and whether the system is running in GUI or headless mode. Supported display servers: - wayland, x11 (Linux/BSD) - quartz (macOS) - dwm (Windows) - surfaceflinger (Android) Returns empty string for headless/console sessions on all platforms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds displayServer field to detect which graphical display server is currently active. This helps identify the graphics stack being used and whether the system is running in GUI or headless mode.
Supported display servers:
Returns empty string for headless/console sessions on all platforms.
What do you think about this feature?
I've tested this on Linux successfully. The implementation for macOS, Windows, and Android is based on documented behavior (pgrep WindowServer, tasklist for dwm.exe, surfaceflinger process), but I haven't been able to test these platforms myself.
The code is designed to be robust - all platform checks are wrapped in try-catch blocks and default to returning an empty string on errors, so nothing should break even if the detection fails.