Files
glassMxrph/scripts/doctor.py
T
mxandClaude Opus 5.5 99e64a7713 Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:36:17 +02:00

29 lines
1.5 KiB
Python

#!/usr/bin/env python3
"""Read-only environment diagnostics. Never starts a shell or changes the session."""
import json
import os
import shutil
import subprocess
import sys
def query(args):
try:
p=subprocess.run(args,capture_output=True,text=True,timeout=4)
return (p.stdout or p.stderr).strip()[:1600] if p.returncode==0 else 'Unavailable'
except (OSError,subprocess.TimeoutExpired):return 'Unavailable'
def report():
required={name:bool(shutil.which(name)) for name in ['quickshell','python3','hyprctl']}
return dict(required=required,
session=dict(wayland=bool(os.environ.get('WAYLAND_DISPLAY')),hyprland=bool(os.environ.get('HYPRLAND_INSTANCE_SIGNATURE')),dbus=bool(os.environ.get('DBUS_SESSION_BUS_ADDRESS'))),
versions=dict(quickshell=query(['quickshell','--version']),hyprland=query(['hyprctl','version']).splitlines()[0]),
hyprglass=dict(plugins=query(['hyprctl','plugin','list']),layers=query(['hyprctl','getoption','plugin:hyprglass:layers:enabled'])),
optional={name:bool(shutil.which(name)) for name in ['matugen','cava','nvidia-smi','brightnessctl','busctl','nm-connection-editor','blueman-manager']},
note='Command discovery only: QML module availability, service capabilities and compositor rules still require runtime validation. No changes made.')
if __name__=='__main__':
result=report();print(json.dumps(result,indent=2))
sys.exit(0 if all(result['required'].values()) and all(result['session'].values()) else 1)