Skip to content

feat: add display server detection to osInfo()#1020

Open
KristjanESPERANTO wants to merge 1 commit intosebhildebrandt:masterfrom
KristjanESPERANTO:displayserver
Open

feat: add display server detection to osInfo()#1020
KristjanESPERANTO wants to merge 1 commit intosebhildebrandt:masterfrom
KristjanESPERANTO:displayserver

Conversation

@KristjanESPERANTO
Copy link

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.


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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant