Files
Panama/config/dot/quickshell/wallpaper-service-harness.qml
T

47 lines
1.4 KiB
QML

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")
});
}
}
}