Signed-off-by: Bloxx12 <charlie@charlieroot.dev> Change-Id: I6a6a6964a68815e795aa84d4a173542c01893d35
55 lines
1.2 KiB
QML
55 lines
1.2 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Wayland
|
|
import Qt.labs.folderlistmodel 2.9
|
|
|
|
PanelWindow {
|
|
id: root
|
|
|
|
exclusionMode: ExclusionMode.Ignore
|
|
WlrLayershell.layer: WlrLayer.Background
|
|
WlrLayershell.namespace: "shell:background"
|
|
|
|
property string basePath: "file:///home/cr/Documents/Backgrounds/"
|
|
property var absPath: folderModel.get(Math.floor(Math.random() * folderModel.count), "filePath")
|
|
property var finalPath: absPath
|
|
|
|
// property bool _: log()
|
|
// function log() {
|
|
// console.log(absPath);
|
|
// console.log(folderModel.count);
|
|
// return true;
|
|
// }
|
|
FolderListModel {
|
|
id: folderModel
|
|
folder: root.basePath
|
|
nameFilters: ["*.png"]
|
|
showDirs: false
|
|
showFiles: true
|
|
}
|
|
|
|
anchors {
|
|
top: true
|
|
bottom: true
|
|
left: true
|
|
right: true
|
|
}
|
|
|
|
Item {
|
|
id: background
|
|
anchors.fill: parent
|
|
Image {
|
|
id: image
|
|
source: Qt.resolvedUrl(root.finalPath)
|
|
}
|
|
}
|
|
Timer {
|
|
id: timer
|
|
// 10 minutes
|
|
interval: 1000 * 60 * 10
|
|
running: false
|
|
onTriggered: {
|
|
root.popupOpacity = 0;
|
|
}
|
|
}
|
|
}
|