usable
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
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
|
||||
|
||||
|
||||
|
||||
ScrollView {
|
||||
//anchors.fill: parent
|
||||
|
||||
required property list<string> hyprcmds
|
||||
|
||||
id: root
|
||||
|
||||
property string dir: "/home/nathan/Pictures/Wallpaper/"
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOn
|
||||
|
||||
Process {
|
||||
id: ls
|
||||
//command: ["find", root.dir + "*"]
|
||||
command: ["ls", dir]
|
||||
running: true
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
rep.model = text.split("\n").filter((s) => { return s != ""; })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
||||
Repeater {
|
||||
id: rep
|
||||
model: 0
|
||||
|
||||
WrapperMouseArea {
|
||||
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: ["setWallpaper", root.dir + rep.model[index]]
|
||||
running: false
|
||||
onRunningChanged: {
|
||||
root.hyprcmds.forEach((c) => Hyprland.dispatch(c))
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
sw.running = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user