summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-02 22:41:25 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-02 22:41:25 +1100
commit7b6a109ad3c306b7122d27cabe7e2a68c166ad55 (patch)
treeed2689a876b2cd02f057dcd59da4b50754ee0579 /src
parentfeat: define bar layout via config (diff)
downloadcaelestia-shell-7b6a109ad3c306b7122d27cabe7e2a68c166ad55.tar.gz
caelestia-shell-7b6a109ad3c306b7122d27cabe7e2a68c166ad55.tar.bz2
caelestia-shell-7b6a109ad3c306b7122d27cabe7e2a68c166ad55.zip
launcher: sort wallpapers and schemes
Diffstat (limited to 'src')
-rw-r--r--src/modules/launcher/actions.tsx3
-rw-r--r--src/services/wallpapers.ts4
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");
}