Files
DeeJanuzandClaude Opus 5.5 42a755b9f4 Add a headless test mode to ft-screens and a throwaway test desktop
ft-screens --no-vr runs without SteamVR and leaves the input relay alone;
--control names its control socket; "toplevels" lists KWin's windows with
their titles and sizes; "input" feeds pointer events as if from a panel.
screens/test/headless.sh starts it with a bare nested KWin next to the
running desktop, and loads KWin scripts, runs apps, and takes screenshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:14:09 -06:00

23 lines
1.4 KiB
JavaScript

// A KWin script for experiments (screens/test/headless.sh script ...): prints what happens
// to windows, for checking the script API floating windows rely on.
function desc(w) {
const g = w.frameGeometry;
return String(w.internalId).slice(1, 9) + " " + w.resourceClass + " pid=" + w.pid + " popup=" + w.popupWindow +
" transient=" + w.transient + " normal=" + w.normalWindow + " dialog=" + w.dialog +
" out=" + (w.output ? w.output.name : "?") + " geo=" + g.x + "," + g.y + " " + g.width + "x" + g.height +
" '" + w.caption + "'";
}
function watch(w) {
print("added " + desc(w));
w.interactiveMoveResizeStarted.connect(() => print("move-start move=" + w.move + " resize=" + w.resize + " " + desc(w)));
w.interactiveMoveResizeStepped.connect(g => print("move-step " + g.x + "," + g.y + " " + g.width + "x" + g.height));
w.interactiveMoveResizeFinished.connect(() => print("move-end " + desc(w)));
w.outputChanged.connect(() => print("output " + desc(w)));
w.fullScreenChanged.connect(() => print("fullscreen " + w.fullScreen + " " + desc(w)));
w.minimizedChanged.connect(() => print("minimized " + w.minimized));
}
workspace.windowList().forEach(watch);
workspace.windowAdded.connect(watch);
workspace.windowRemoved.connect(w => print("removed " + desc(w)));
workspace.windowActivated.connect(w => print("activated " + (w ? w.resourceClass : "none")));