Files
Aurora/config/aurora/modules/Wallpaper.qml
2026-04-10 16:41:31 -05:00

99 lines
2.3 KiB
QML

import Quickshell // for PanelWindow
import QtQuick // for Text
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Io
import Quickshell.Widgets
import Quickshell.Hyprland
import Quickshell.Services.Pipewire
Flickable {
//anchors.fill: parent
required property list<string> hyprcmds
id: root
property string dir: Settings.wallpaperDir
implicitHeight: lay.height
implicitWidth: 750
interactive: true
contentWidth: lay.width
flickDeceleration: 5000
WheelHandler {
target: root
//property: "contentX"
onWheel: {
console.log("test")
}
}
Process {
id: ls
//command: ["find", root.dir + "*"]
command: ["ls", dir]
running: true
stdout: StdioCollector {
onStreamFinished: {
rep.model = text.split("\n").filter((s) => { return s != ""; })
}
}
}
Timer {
id: cct
running: false
repeat: false
interval: 3
onTriggered: {
Settings.changeColors.running = true
}
}
RowLayout {
id: lay
Repeater {
id: rep
model: 0
WrapperMouseArea {
onWheel: (e) => {
root.flick(e.angleDelta.y * 15, 0)
}
ClippingWrapperRectangle {
radius: 10
implicitWidth: 192 * 2; implicitHeight: 108 * 2
Image {
width: 192 * 2; height: 108 * 2
source: Qt.resolvedUrl(root.dir + "/" + rep.model[index])
fillMode: Image.PreserveAspectCrop
sourceSize.width: 192 * 2
sourceSize.height: 108 * 2
}
}
property Process sw: Process {
command: ["aurora-set-wallpaper", root.dir + "/" + rep.model[index]]
running: false
onRunningChanged: {
root.hyprcmds.forEach((c) => Hyprland.dispatch(c))
}
}
onClicked: {
sw.running = true
cct.running = true
}
}
}
}
}