feat: actually set wallpaper
Make launcher wallpaper picker actually work
This commit is contained in:
parent
0505ba8f92
commit
4c84e4fff3
4 changed files with 21 additions and 4 deletions
|
|
@ -70,8 +70,8 @@ Item {
|
|||
const currentItem = list.currentList?.currentItem;
|
||||
if (currentItem) {
|
||||
if (list.showWallpapers) {
|
||||
// TODO
|
||||
console.log(currentItem.modelData.path);
|
||||
Wallpapers.setWallpaper(currentItem.modelData.path);
|
||||
root.launcher.launcherVisible = false;
|
||||
} else if (text.startsWith(LauncherConfig.actionPrefix)) {
|
||||
currentItem.modelData.onClicked(list.currentList);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ StyledRect {
|
|||
id: root
|
||||
|
||||
required property Wallpapers.Wallpaper modelData
|
||||
required property Scope launcher
|
||||
|
||||
scale: 0.5
|
||||
opacity: 0
|
||||
|
|
@ -26,7 +27,8 @@ StyledRect {
|
|||
radius: Appearance.rounding.normal
|
||||
|
||||
function onClicked(): void {
|
||||
console.log("clicked");
|
||||
Wallpapers.setWallpaper(root.modelData.path);
|
||||
root.launcher.launcherVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ PathView {
|
|||
highlightRangeMode: PathView.StrictlyEnforceRange
|
||||
highlightMoveDuration: Appearance.anim.durations.short
|
||||
|
||||
delegate: WallpaperItem {}
|
||||
delegate: WallpaperItem {
|
||||
launcher: root.launcher
|
||||
}
|
||||
|
||||
path: Path {
|
||||
startY: root.height / 2
|
||||
|
|
|
|||
|
|
@ -26,6 +26,19 @@ Singleton {
|
|||
}).map(r => r.obj.wall);
|
||||
}
|
||||
|
||||
function setWallpaper(path: string): void {
|
||||
setWall.path = path;
|
||||
setWall.startDetached();
|
||||
}
|
||||
|
||||
Process {
|
||||
id: setWall
|
||||
|
||||
property string path
|
||||
|
||||
command: ["caelestia", "wallpaper", "-f", path]
|
||||
}
|
||||
|
||||
Process {
|
||||
running: true
|
||||
command: ["fd", ".", root.path, "-t", "f", "-e", "jpg", "-e", "jpeg", "-e", "png", "-e", "svg"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue