Verify wallpaper policy application

This commit is contained in:
Gabriel Brown
2026-08-18 15:00:18 -04:00
parent c8004e400a
commit 52818b7290
3 changed files with 404 additions and 80 deletions
@@ -0,0 +1,46 @@
import Quickshell
import Quickshell.Io
import QtQuick
import qs.config
import qs.services
ShellRoot {
Component.onCompleted: {
Wallpaper.outputNames = function() { return ["DP-2", "HDMI-A-1"]; };
Wallpaper.startupRestoreEnabled = false;
Wallpaper.available = ["/images/a.jpg", "/images/b.jpg", "/images/c.jpg"];
}
IpcHandler {
target: "wallpaper-service-test"
function applyPerMonitor(): bool {
return Wallpaper.applyPolicy({
mode: "per-monitor",
globalPath: "/images/a.jpg",
collection: [],
intervalMinutes: 30,
shuffle: true,
assignments: { "HDMI-A-1": "/images/b.jpg" },
slideshowPath: ""
}, true);
}
function applySingle(path: string): bool {
return Wallpaper.set(path);
}
function status(): string {
return JSON.stringify({
busy: Wallpaper.busy,
lastError: Wallpaper.lastError,
activeByOutput: Wallpaper.activeByOutput,
active: Wallpaper.active,
mode: DesktopPreferences.get("wallpaperMode"),
path: DesktopPreferences.get("wallpaperPath"),
assignments: DesktopPreferences.get("wallpaperPerMonitor")
});
}
}
}