diff options
| -rw-r--r-- | src/modules/launcher/actions.tsx | 3 | ||||
| -rw-r--r-- | src/services/wallpapers.ts | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/launcher/actions.tsx b/src/modules/launcher/actions.tsx index 03db28b..6b5df52 100644 --- a/src/modules/launcher/actions.tsx +++ b/src/modules/launcher/actions.tsx @@ -386,7 +386,8 @@ export default class Actions extends Widget.Box implements LauncherContent { const scheme = args[1] ?? ""; const schemes = Object.values(Schemes.get_default().map) .flatMap(s => (s.colours ? s.name : Object.values(s.flavours!).map(f => `${f.scheme}-${f.name}`))) - .filter(s => s !== undefined); + .filter(s => s !== undefined) + .sort(); for (const { target } of fuzzysort.go(scheme, schemes, { all: true })) { if (Schemes.get_default().map.hasOwnProperty(target)) this.#content.add(<Scheme {...Schemes.get_default().map[target]} />); 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"); } |