This is a projection, not a development branch. The tree above was constructed from the internal source named below under a manifest that decides which paths may leave, then scanned as a whole tree rather than as a series of patches, and only then published. Public history starts here because the history before it was not admissible, and neither was the tree. What used to stand in this repository included a rescue copy of another machine, a directory of phone handoffs, deployment wired to one house, and a submodule pointing at a forge no stranger can reach. None of that was ever the product. It stays in the private forge, which is allowed to hold the whole working organism, and this is what was deliberately sent out instead. Three mechanisms produced this tree, in decreasing order of trust. A top-level path the manifest does not name never arrives at all, which is the one that catches directories nobody has thought of yet. Named internal files inside admitted roots are dropped. A short, reviewed table replaces deployment defaults that a public build must not carry -- an endpoint aimed at one LAN, a VPN profile belonging to one phone, packaging built from one checkout path. Everything after this commit is an ordinary publication with the same three trailers, so a force push stops being routine and starts meaning that something deliberate happened. The trailers bind the projection to its source without pretending the public SHA is the private one: same lineage, different tree, and the record says so. Source-Sha: 8f27b1e76a8fef560a336aba18e6990713ff1047 Policy-Sha: 6b261d2f3e6e1fb19874846ba4bb1dfe15565d25b8618c1c1afba0419c101d27 Tree-Digest: 18ec3563c5e5ef9a414993a9f6734b251ff9ed3cd56eebdd6cac01e45c6e3067
102 lines
4.6 KiB
QML
102 lines
4.6 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
import qs
|
|
import qs.modules.common
|
|
import qs.modules.common.functions
|
|
import qs.modules.common.widgets.widgetCanvas
|
|
|
|
AbstractWidget {
|
|
id: root
|
|
|
|
required property string configEntryName
|
|
required property int screenWidth
|
|
required property int screenHeight
|
|
required property int scaledScreenWidth
|
|
required property int scaledScreenHeight
|
|
required property real wallpaperScale
|
|
property bool visibleWhenLocked: false
|
|
property var configEntry: Config.options.background.widgets[configEntryName]
|
|
property string placementStrategy: configEntry.placementStrategy
|
|
property real targetX: Math.max(0, Math.min(configEntry.x, scaledScreenWidth - width))
|
|
property real targetY : Math.max(0, Math.min(configEntry.y, scaledScreenHeight - height))
|
|
x: targetX
|
|
y: targetY
|
|
visible: opacity > 0
|
|
opacity: (GlobalStates.screenLocked && !visibleWhenLocked) ? 0 : 1
|
|
Behavior on opacity {
|
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
|
}
|
|
scale: (draggable && containsPress) ? 1.05 : 1
|
|
Behavior on scale {
|
|
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
|
|
}
|
|
|
|
draggable: placementStrategy === "free"
|
|
onReleased: {
|
|
root.targetX = root.x;
|
|
root.targetY = root.y;
|
|
configEntry.x = root.targetX;
|
|
configEntry.y = root.targetY;
|
|
}
|
|
|
|
property bool needsColText: false
|
|
property color dominantColor: Appearance.colors.colPrimary
|
|
property bool dominantColorIsDark: dominantColor.hslLightness < 0.5
|
|
property color colText: {
|
|
const onNormalBackground = (GlobalStates.screenLocked && Config.options.lock.blur.enable)
|
|
const adaptiveColor = ColorUtils.colorWithLightness(Appearance.colors.colPrimary, (dominantColorIsDark ? 0.8 : 0.12))
|
|
return onNormalBackground ? Appearance.colors.colOnLayer0 : adaptiveColor;
|
|
}
|
|
|
|
property bool wallpaperIsVideo: Config.options.background.wallpaperPath.endsWith(".mp4") || Config.options.background.wallpaperPath.endsWith(".webm") || Config.options.background.wallpaperPath.endsWith(".mkv") || Config.options.background.wallpaperPath.endsWith(".avi") || Config.options.background.wallpaperPath.endsWith(".mov")
|
|
property string wallpaperPath: wallpaperIsVideo ? Config.options.background.thumbnailPath : Config.options.background.wallpaperPath
|
|
|
|
onWallpaperPathChanged: refreshPlacementIfNeeded()
|
|
onPlacementStrategyChanged: refreshPlacementIfNeeded()
|
|
Connections {
|
|
target: Config
|
|
function onReadyChanged() { refreshPlacementIfNeeded() }
|
|
}
|
|
function refreshPlacementIfNeeded() {
|
|
if (!Config.ready) return;
|
|
if (root.placementStrategy === "free" && !root.needsColText) return;
|
|
leastBusyRegionProc.wallpaperPath = root.wallpaperPath;
|
|
leastBusyRegionProc.running = false;
|
|
leastBusyRegionProc.running = true;
|
|
}
|
|
Process {
|
|
id: leastBusyRegionProc
|
|
property string wallpaperPath: root.wallpaperPath
|
|
// TODO: make these less arbitrary
|
|
property int contentWidth: 300
|
|
property int contentHeight: 300
|
|
property int horizontalPadding: 200
|
|
property int verticalPadding: 200
|
|
command: [Quickshell.shellPath("scripts/images/least-busy-region-venv.sh") // Comments to force the formatter to break lines
|
|
, "--screen-width", Math.round(root.scaledScreenWidth) //
|
|
, "--screen-height", Math.round(root.scaledScreenHeight) //
|
|
, "--width", contentWidth //
|
|
, "--height", contentHeight //
|
|
, "--horizontal-padding", horizontalPadding //
|
|
, "--vertical-padding", verticalPadding //
|
|
, wallpaperPath //
|
|
, ...(root.placementStrategy === "mostBusy" ? ["--busiest"] : [])
|
|
// "--visual-output",
|
|
]
|
|
stdout: StdioCollector {
|
|
id: leastBusyRegionOutputCollector
|
|
onStreamFinished: {
|
|
const output = leastBusyRegionOutputCollector.text;
|
|
// console.log("[Background] Least busy region output:", output)
|
|
if (output.length === 0) return;
|
|
const parsedContent = JSON.parse(output);
|
|
root.dominantColor = parsedContent.dominant_color || Appearance.colors.colPrimary;
|
|
if (root.placementStrategy === "free") return;
|
|
root.targetX = parsedContent.center_x * root.wallpaperScale - root.width / 2;
|
|
root.targetY = parsedContent.center_y * root.wallpaperScale - root.height / 2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|