pragma Singleton import QtQuick import Quickshell // Desktop widget types. Sizes are logical pixels; `variants` maps id -> label; // `options` lists editable per-widget options shown in the editor inspector; // `background: false` draws the face without the glass card. Singleton { readonly property var order: ["clock", "calendar", "weather", "music", "visualizer", "cpu", "ram", "gpu", "temp", "disk", "network", "user", "image", "note"] readonly property var types: ({ clock: { name: "Clock", icon: "󰥔", file: "faces/ClockFace.qml", size: [260, 130], min: [140, 70], variants: { digital: "Digital", analog: "Analog", minimal: "Minimal" }, transparent: ["minimal"], options: [ { id: "seconds", label: "Show seconds", kind: "toggle" } ] }, calendar: { name: "Calendar", icon: "󰃭", file: "faces/CalendarFace.qml", size: [270, 260], min: [210, 200] }, weather: { name: "Weather", icon: "󰖐", file: "faces/WeatherFace.qml", size: [270, 140], min: [180, 100], options: [ { id: "location", label: "Location (blank = automatic)", kind: "text" }, { id: "fahrenheit", label: "Fahrenheit", kind: "toggle" } ] }, music: { name: "Music", icon: "󰝚", file: "faces/MusicFace.qml", size: [380, 160], min: [320, 140] }, visualizer: { name: "Visualizer", icon: "󰺢", file: "faces/VisualizerFace.qml", size: [420, 120], min: [140, 50], variants: { bars: "Bars", mirror: "Mirror" }, transparent: ["bars", "mirror"] }, cpu: { name: "CPU", icon: "󰻠", file: "faces/UsageFace.qml", size: [180, 130], min: [110, 80] }, ram: { name: "Memory", icon: "󰍛", file: "faces/UsageFace.qml", size: [180, 130], min: [110, 80] }, gpu: { name: "GPU", icon: "󰢮", file: "faces/UsageFace.qml", size: [180, 130], min: [110, 80] }, temp: { name: "CPU temp", icon: "󰔏", file: "faces/UsageFace.qml", size: [180, 130], min: [110, 80] }, disk: { name: "Disk", icon: "󰋊", file: "faces/UsageFace.qml", size: [180, 130], min: [110, 80] }, network: { name: "Network", icon: "󰛳", file: "faces/NetworkFace.qml", size: [270, 140], min: [180, 100] }, user: { name: "User", icon: "󰀄", file: "faces/UserFace.qml", size: [290, 120], min: [230, 100] }, image: { name: "Image", icon: "󰋩", file: "faces/ImageFace.qml", size: [300, 200], min: [60, 60], variants: { rounded: "Rounded", rect: "Square", round: "Circle" }, transparent: ["rounded", "rect", "round"], options: [ { id: "path", label: "Image file", kind: "text" } ] }, note: { name: "Note", icon: "󰎚", file: "faces/NoteFace.qml", size: [240, 200], min: [150, 100], keyboard: true } }) function type(id) { return Object.prototype.hasOwnProperty.call(types, id) ? types[id] : null; } function variants(id) { const t = type(id); return t && t.variants ? Object.keys(t.variants) : []; } function defaultVariant(id) { const v = variants(id); return v.length ? v[0] : "default"; } function transparent(id, variant) { const t = type(id); return !!t && !!t.transparent && t.transparent.includes(variant); } function source(id) { const t = type(id); return t ? Qt.resolvedUrl(t.file) : ""; } }