import Quickshell import Quickshell.Io import QtQuick import qs.config import qs.services ShellRoot { IpcHandler { target: "settings-system-test" function refresh(): void { SystemSettings.refresh(); } // One batch, matching how the shell applies persisted policy. Three // separate setters would be refused as overlapping writes, since each // one is only complete after its value has been read back. function apply(autoHdr: bool, vrr: int, directScanout: int): void { SystemSettings.applyOptions({ autoHdr: autoHdr, vrrPolicy: vrr, directScanoutPolicy: directScanout }); } // Applies an arbitrary batch of schema keys, so the contract can cover // every getoption answer shape -- int, bool, float, str, and the css // box that gaps read back as -- not just the display policies. function applyJson(payload: string): bool { return SystemSettings.applyOptions(JSON.parse(payload)); } function panelAllowed(panel: string): bool { return SystemSettings.isGnomePanelAllowed(panel); } function status(): string { return JSON.stringify({ monitorName: SystemSettings.monitorName, monitorDescription: SystemSettings.monitorDescription, width: SystemSettings.monitorWidth, height: SystemSettings.monitorHeight, scale: SystemSettings.monitorScale, format: SystemSettings.monitorFormat, busy: SystemSettings.busy, lastError: SystemSettings.lastError }); } } }