From 5823a43aaf52dba351686ddb013dbb4d3bc583e5 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Wed, 29 Jan 2025 15:44:51 +1100
Subject: bar: hide tray when no items

---
 src/modules/bar.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/modules/bar.tsx')

diff --git a/src/modules/bar.tsx b/src/modules/bar.tsx
index 5faee7a..eb42d0b 100644
--- a/src/modules/bar.tsx
+++ b/src/modules/bar.tsx
@@ -220,7 +220,11 @@ const TrayItem = (item: AstalTray.TrayItem) => {
     );
 };
 
-const Tray = () => <box className="module tray">{bind(AstalTray.get_default(), "items").as(i => i.map(TrayItem))}</box>;
+const Tray = () => (
+    <box className="module tray" visible={bind(AstalTray.get_default(), "items").as(i => i.length > 0)}>
+        {bind(AstalTray.get_default(), "items").as(i => i.map(TrayItem))}
+    </box>
+);
 
 const Network = () => (
     <button
-- 
cgit v1.2.3-freya

