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;
|
const currentItem = list.currentList?.currentItem;
|
||||||
if (currentItem) {
|
if (currentItem) {
|
||||||
if (list.showWallpapers) {
|
if (list.showWallpapers) {
|
||||||
// TODO
|
Wallpapers.setWallpaper(currentItem.modelData.path);
|
||||||
console.log(currentItem.modelData.path);
|
root.launcher.launcherVisible = false;
|
||||||
} else if (text.startsWith(LauncherConfig.actionPrefix)) {
|
} else if (text.startsWith(LauncherConfig.actionPrefix)) {
|
||||||
currentItem.modelData.onClicked(list.currentList);
|
currentItem.modelData.onClicked(list.currentList);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ StyledRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property Wallpapers.Wallpaper modelData
|
required property Wallpapers.Wallpaper modelData
|
||||||
|
required property Scope launcher
|
||||||
|
|
||||||
scale: 0.5
|
scale: 0.5
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
@ -26,7 +27,8 @@ StyledRect {
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
|
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
console.log("clicked");
|
Wallpapers.setWallpaper(root.modelData.path);
|
||||||
|
root.launcher.launcherVisible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ PathView {
|
||||||
highlightRangeMode: PathView.StrictlyEnforceRange
|
highlightRangeMode: PathView.StrictlyEnforceRange
|
||||||
highlightMoveDuration: Appearance.anim.durations.short
|
highlightMoveDuration: Appearance.anim.durations.short
|
||||||
|
|
||||||
delegate: WallpaperItem {}
|
delegate: WallpaperItem {
|
||||||
|
launcher: root.launcher
|
||||||
|
}
|
||||||
|
|
||||||
path: Path {
|
path: Path {
|
||||||
startY: root.height / 2
|
startY: root.height / 2
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,19 @@ Singleton {
|
||||||
}).map(r => r.obj.wall);
|
}).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 {
|
Process {
|
||||||
running: true
|
running: true
|
||||||
command: ["fd", ".", root.path, "-t", "f", "-e", "jpg", "-e", "jpeg", "-e", "png", "-e", "svg"]
|
command: ["fd", ".", root.path, "-t", "f", "-e", "jpg", "-e", "jpeg", "-e", "png", "-e", "svg"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue