summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-18 13:41:37 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-18 13:41:37 +1100
commit18921c6847829fcbe11834ef1fc1ad73a854b2f2 (patch)
treee5b86a33f2a53d0f2bf10bf8e6bf67c27de4049e /src/services
parentlauncher: fix wallpaper categories compact mode (diff)
downloadcaelestia-shell-18921c6847829fcbe11834ef1fc1ad73a854b2f2.tar.gz
caelestia-shell-18921c6847829fcbe11834ef1fc1ad73a854b2f2.tar.bz2
caelestia-shell-18921c6847829fcbe11834ef1fc1ad73a854b2f2.zip
updates: show updates for custom repos
Diffstat (limited to 'src/services')
-rw-r--r--src/services/updates.ts34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/services/updates.ts b/src/services/updates.ts
index 8477733..b58609b 100644
--- a/src/services/updates.ts
+++ b/src/services/updates.ts
@@ -92,6 +92,19 @@ export default class Updates extends GObject.Object {
);
}
+ getRepoIcon(repo: string) {
+ switch (repo) {
+ case "core":
+ return "hub";
+ case "extra":
+ return "add_circle";
+ case "multilib":
+ return "account_tree";
+ default:
+ return "deployed_code_update";
+ }
+ }
+
getUpdates() {
// Return if already getting updates
if (this.#loading) return;
@@ -106,21 +119,14 @@ export default class Updates extends GObject.Object {
// Pacman updates (checkupdates)
if (pacman.status === "fulfilled") {
- const repos: Repo[] = [
- { repo: await this.getRepo("core"), updates: [], icon: "hub", name: "Core repository" },
- {
- repo: await this.getRepo("extra"),
- updates: [],
- icon: "add_circle",
- name: "Extra repository",
- },
- {
- repo: await this.getRepo("multilib"),
+ const repos: Repo[] = await Promise.all(
+ (await execAsync("pacman-conf -l")).split("\n").map(async r => ({
+ repo: await this.getRepo(r),
updates: [],
- icon: "account_tree",
- name: "Multilib repository",
- },
- ];
+ icon: this.getRepoIcon(r),
+ name: r[0].toUpperCase() + r.slice(1) + " repository",
+ }))
+ );
for (const update of pacman.value.split("\n")) {
const pkg = update.split(" ")[0];