From 9f843558c029daa85cdcb6bc20e7b837c751be08 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Wed, 15 Jan 2025 13:15:06 +1100
Subject: bar: update indicator

---
 modules/bar.tsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'modules/bar.tsx')

diff --git a/modules/bar.tsx b/modules/bar.tsx
index a928ae8..a6ff6d1 100644
--- a/modules/bar.tsx
+++ b/modules/bar.tsx
@@ -8,6 +8,7 @@ import AstalNotifd from "gi://AstalNotifd";
 import AstalTray from "gi://AstalTray";
 import { bar as config } from "../config";
 import Players from "../services/players";
+import Updates from "../services/updates";
 import { getAppCategoryIcon } from "../utils/icons";
 import { ellipsize } from "../utils/strings";
 import { osIcon } from "../utils/system";
@@ -307,6 +308,21 @@ const StatusIcons = () => (
     </box>
 );
 
+const PkgUpdates = () => (
+    <box
+        className="module updates"
+        setup={self =>
+            setupCustomTooltip(
+                self,
+                bind(Updates.get_default(), "numUpdates").as(n => `${n} update${n === 1 ? "" : "s"} available`)
+            )
+        }
+    >
+        <label className="icon" label="download" />
+        <label label={bind(Updates.get_default(), "numUpdates").as(String)} />
+    </box>
+);
+
 const Notifications = () => {
     const unreadCount = Variable(0);
     return (
@@ -396,6 +412,7 @@ export default ({ monitor }: { monitor: AstalHyprland.Monitor }) => (
             <box halign={Gtk.Align.END}>
                 <Tray />
                 <StatusIcons />
+                <PkgUpdates />
                 <Notifications />
                 <DateTime />
                 <Power />
-- 
cgit v1.2.3-freya

