diff options
| -rw-r--r-- | modules/launcher/Content.qml | 4 | ||||
| -rw-r--r-- | modules/launcher/WallpaperItem.qml | 4 | ||||
| -rw-r--r-- | modules/launcher/WallpaperList.qml | 4 | ||||
| -rw-r--r-- | services/Wallpapers.qml | 13 |
4 files changed, 21 insertions, 4 deletions
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index be6be2e..9759abb 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -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 { diff --git a/modules/launcher/WallpaperItem.qml b/modules/launcher/WallpaperItem.qml index e21743c..c0b91d4 100644 --- a/modules/launcher/WallpaperItem.qml +++ b/modules/launcher/WallpaperItem.qml @@ -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; } } diff --git a/modules/launcher/WallpaperList.qml b/modules/launcher/WallpaperList.qml index e3bf2ee..4030739 100644 --- a/modules/launcher/WallpaperList.qml +++ b/modules/launcher/WallpaperList.qml @@ -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 diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml index bd6528d..867d082 100644 --- a/services/Wallpapers.qml +++ b/services/Wallpapers.qml @@ -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"] |