From 7b6a109ad3c306b7122d27cabe7e2a68c166ad55 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 2 Apr 2025 22:41:25 +1100 Subject: launcher: sort wallpapers and schemes --- src/services/wallpapers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/services') diff --git a/src/services/wallpapers.ts b/src/services/wallpapers.ts index f0a68af..f1f13a5 100644 --- a/src/services/wallpapers.ts +++ b/src/services/wallpapers.ts @@ -59,13 +59,15 @@ export default class Wallpapers extends GObject.Object { const list = (await execAsync(["fish", "-c", `identify -ping -format '%i\n' ${files} ; true`])).split("\n"); this.#list = await Promise.all(list.map(async p => ({ path: p, thumbnail: await Thumbnailer.thumbnail(p) }))); + this.#list.sort((a, b) => a.path.localeCompare(b.path)); this.notify("list"); const categories = await Promise.all(successes.map(r => this.#listDir(r.path, "d"))); this.#categories = categories .flatMap(c => c.split("\n")) .map(c => ({ path: c, wallpapers: this.#list.filter(w => w.path.startsWith(c)) })) - .filter(c => c.wallpapers.length > 0); + .filter(c => c.wallpapers.length > 0) + .sort((a, b) => a.path.localeCompare(b.path)); this.notify("categories"); } -- cgit v1.2.3-freya